<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - HTTP and IO functions</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="https://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="https://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="https://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">HTTP and IO functions</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Tue Apr 20 2021 by Robert van Engelen</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__io.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">HTTP and IO functions</div>  </div>
</div><!--header-->
<div class="contents">

<p>This module defines functions for HTTP operations and functions for receiving and sending data.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga17cdc287dd916e5d2b3467ccec177d5a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga17cdc287dd916e5d2b3467ccec177d5a">SOAP_HTML</a></td></tr>
<tr class="memdesc:ga17cdc287dd916e5d2b3467ccec177d5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">A special <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code to signal that a custom HTTP response is present and no HTTP response must be produced.  <a href="#ga17cdc287dd916e5d2b3467ccec177d5a">More...</a><br /></td></tr>
<tr class="separator:ga17cdc287dd916e5d2b3467ccec177d5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga05be99343f556fe70940145e874cdb99"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a></td></tr>
<tr class="memdesc:ga05be99343f556fe70940145e874cdb99"><td class="mdescLeft">&#160;</td><td class="mdescRight">A special <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code to signal that a custom file-based HTTP response is present and no HTTP response must be produced.  <a href="#ga05be99343f556fe70940145e874cdb99">More...</a><br /></td></tr>
<tr class="separator:ga05be99343f556fe70940145e874cdb99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga41f39e73106f1a2283ae3aa65698050f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f">SOAP_POST</a></td></tr>
<tr class="memdesc:ga41f39e73106f1a2283ae3aa65698050f"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP POST command code.  <a href="#ga41f39e73106f1a2283ae3aa65698050f">More...</a><br /></td></tr>
<tr class="separator:ga41f39e73106f1a2283ae3aa65698050f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c291263eadcefa290e90c64e632ae47"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47">SOAP_POST_FILE</a></td></tr>
<tr class="memdesc:ga4c291263eadcefa290e90c64e632ae47"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP POST command code with custom content type.  <a href="#ga4c291263eadcefa290e90c64e632ae47">More...</a><br /></td></tr>
<tr class="separator:ga4c291263eadcefa290e90c64e632ae47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3abcdd760843c4bdc56c19b85453ed04"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04">SOAP_GET</a></td></tr>
<tr class="memdesc:ga3abcdd760843c4bdc56c19b85453ed04"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP GET command code.  <a href="#ga3abcdd760843c4bdc56c19b85453ed04">More...</a><br /></td></tr>
<tr class="separator:ga3abcdd760843c4bdc56c19b85453ed04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga32a114ef8df190363b9c3ad37bcb6335"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335">SOAP_PUT</a></td></tr>
<tr class="memdesc:ga32a114ef8df190363b9c3ad37bcb6335"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP PUT command code with custom content type.  <a href="#ga32a114ef8df190363b9c3ad37bcb6335">More...</a><br /></td></tr>
<tr class="separator:ga32a114ef8df190363b9c3ad37bcb6335"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6e1b491acf772e88f64909ee5baae18d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga6e1b491acf772e88f64909ee5baae18d">SOAP_DEL</a></td></tr>
<tr class="memdesc:ga6e1b491acf772e88f64909ee5baae18d"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP DEL command code.  <a href="#ga6e1b491acf772e88f64909ee5baae18d">More...</a><br /></td></tr>
<tr class="separator:ga6e1b491acf772e88f64909ee5baae18d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf0409312a4af954ee5b183b92967e0b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaaf0409312a4af954ee5b183b92967e0b">SOAP_CONNECT</a></td></tr>
<tr class="memdesc:gaaf0409312a4af954ee5b183b92967e0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP CONNECT command code.  <a href="#gaaf0409312a4af954ee5b183b92967e0b">More...</a><br /></td></tr>
<tr class="separator:gaaf0409312a4af954ee5b183b92967e0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga31ba86b35e83440e4047b021add6fe2c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga31ba86b35e83440e4047b021add6fe2c">SOAP_HEAD</a></td></tr>
<tr class="memdesc:ga31ba86b35e83440e4047b021add6fe2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP HEAD command code.  <a href="#ga31ba86b35e83440e4047b021add6fe2c">More...</a><br /></td></tr>
<tr class="separator:ga31ba86b35e83440e4047b021add6fe2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab85d36efa8017c3d328289e25318fb18"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gab85d36efa8017c3d328289e25318fb18">SOAP_OPTIONS</a></td></tr>
<tr class="memdesc:gab85d36efa8017c3d328289e25318fb18"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP OPTIONS command code.  <a href="#gab85d36efa8017c3d328289e25318fb18">More...</a><br /></td></tr>
<tr class="separator:gab85d36efa8017c3d328289e25318fb18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f6661cfe8eff845600e7a75a2f46701"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701">SOAP_PATCH</a></td></tr>
<tr class="memdesc:ga0f6661cfe8eff845600e7a75a2f46701"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP PATCH command code with custom content type.  <a href="#ga0f6661cfe8eff845600e7a75a2f46701">More...</a><br /></td></tr>
<tr class="separator:ga0f6661cfe8eff845600e7a75a2f46701"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga3b89c45fdd4914818fde0fd30013335e"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e">soap_http_command</a></td></tr>
<tr class="memdesc:ga3b89c45fdd4914818fde0fd30013335e"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP command methods for <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>  <a href="#ga3b89c45fdd4914818fde0fd30013335e">More...</a><br /></td></tr>
<tr class="separator:ga3b89c45fdd4914818fde0fd30013335e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c7ca927c25cf2e5f03d0add91b3eb6d"><td class="memItemLeft" align="right" valign="top">typedef int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a></td></tr>
<tr class="memdesc:ga0c7ca927c25cf2e5f03d0add91b3eb6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wide char type.  <a href="#ga0c7ca927c25cf2e5f03d0add91b3eb6d">More...</a><br /></td></tr>
<tr class="separator:ga0c7ca927c25cf2e5f03d0add91b3eb6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga953bdee7ebf242b056834e5592079ae9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9">soap_GET</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint, const char *action)</td></tr>
<tr class="memdesc:ga953bdee7ebf242b056834e5592079ae9"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP GET content from server.  <a href="#ga953bdee7ebf242b056834e5592079ae9">More...</a><br /></td></tr>
<tr class="separator:ga953bdee7ebf242b056834e5592079ae9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae93e23c11379e71baeb6fafe68e14709"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709">soap_PUT</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint, const char *action, const char *type)</td></tr>
<tr class="memdesc:gae93e23c11379e71baeb6fafe68e14709"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP PUT content to server.  <a href="#gae93e23c11379e71baeb6fafe68e14709">More...</a><br /></td></tr>
<tr class="separator:gae93e23c11379e71baeb6fafe68e14709"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga71eebf1ab266c7480831a2fb10b6ca1a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a">soap_PATCH</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint, const char *action, const char *type)</td></tr>
<tr class="memdesc:ga71eebf1ab266c7480831a2fb10b6ca1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP PATCH content to server.  <a href="#ga71eebf1ab266c7480831a2fb10b6ca1a">More...</a><br /></td></tr>
<tr class="separator:ga71eebf1ab266c7480831a2fb10b6ca1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf502246613cb6d4ea120965065d8c0b2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2">soap_POST</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint, const char *action, const char *type)</td></tr>
<tr class="memdesc:gaf502246613cb6d4ea120965065d8c0b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP POST content to server.  <a href="#gaf502246613cb6d4ea120965065d8c0b2">More...</a><br /></td></tr>
<tr class="separator:gaf502246613cb6d4ea120965065d8c0b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98e63f6969d2d83a31f178728a01c7cc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc">soap_DELETE</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint)</td></tr>
<tr class="memdesc:ga98e63f6969d2d83a31f178728a01c7cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">HTTP DELETE content from server.  <a href="#ga98e63f6969d2d83a31f178728a01c7cc">More...</a><br /></td></tr>
<tr class="separator:ga98e63f6969d2d83a31f178728a01c7cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga315b6e1d5888780bf4ef320c50f23796"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, <a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e">soap_http_command</a> http_command, const char *endpoint, const char *action)</td></tr>
<tr class="memdesc:ga315b6e1d5888780bf4ef320c50f23796"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to a server.  <a href="#ga315b6e1d5888780bf4ef320c50f23796">More...</a><br /></td></tr>
<tr class="separator:ga315b6e1d5888780bf4ef320c50f23796"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5c87e9d0a43fe18cc349c724f198f64a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga5c87e9d0a43fe18cc349c724f198f64a">soap_connect</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *endpoint, const char *action)</td></tr>
<tr class="memdesc:ga5c87e9d0a43fe18cc349c724f198f64a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to a server using HTTP POST.  <a href="#ga5c87e9d0a43fe18cc349c724f198f64a">More...</a><br /></td></tr>
<tr class="separator:ga5c87e9d0a43fe18cc349c724f198f64a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a9725a3edbc27b97456190fee47cc18"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__soap.html#ga6eb1bde7cecc2fbadbcbbc6395227439">SOAP_SOCKET</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *host, int port, int backlog)</td></tr>
<tr class="memdesc:ga0a9725a3edbc27b97456190fee47cc18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bind and listen to a port.  <a href="#ga0a9725a3edbc27b97456190fee47cc18">More...</a><br /></td></tr>
<tr class="separator:ga0a9725a3edbc27b97456190fee47cc18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec0e1aecc2d5479d8099762feb4713c6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__soap.html#ga6eb1bde7cecc2fbadbcbbc6395227439">SOAP_SOCKET</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaec0e1aecc2d5479d8099762feb4713c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accept a connection with a client.  <a href="#gaec0e1aecc2d5479d8099762feb4713c6">More...</a><br /></td></tr>
<tr class="separator:gaec0e1aecc2d5479d8099762feb4713c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51dba7706a505240bd8935c0b28e419d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga51dba7706a505240bd8935c0b28e419d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serve a pending request.  <a href="#ga51dba7706a505240bd8935c0b28e419d">More...</a><br /></td></tr>
<tr class="separator:ga51dba7706a505240bd8935c0b28e419d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5652f1b77271d434d0a4b66d5a607adb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb">soap_begin_serve</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga5652f1b77271d434d0a4b66d5a607adb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiates serving a pending client request.  <a href="#ga5652f1b77271d434d0a4b66d5a607adb">More...</a><br /></td></tr>
<tr class="separator:ga5652f1b77271d434d0a4b66d5a607adb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e138b90120efda4a1259d93d79bd2ad"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga4e138b90120efda4a1259d93d79bd2ad">soap_serve_request</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga4e138b90120efda4a1259d93d79bd2ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Process a pending request.  <a href="#ga4e138b90120efda4a1259d93d79bd2ad">More...</a><br /></td></tr>
<tr class="separator:ga4e138b90120efda4a1259d93d79bd2ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0390e58bd2a3ebe6fe3a46de0534a614"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, int status)</td></tr>
<tr class="memdesc:ga0390e58bd2a3ebe6fe3a46de0534a614"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the context for server-side sending and send a HTTP response header.  <a href="#ga0390e58bd2a3ebe6fe3a46de0534a614">More...</a><br /></td></tr>
<tr class="separator:ga0390e58bd2a3ebe6fe3a46de0534a614"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4ce538944f65ac97d82bfeaa9345c42"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaf4ce538944f65ac97d82bfeaa9345c42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the context for receiving.  <a href="#gaf4ce538944f65ac97d82bfeaa9345c42">More...</a><br /></td></tr>
<tr class="separator:gaf4ce538944f65ac97d82bfeaa9345c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga86b0c04e8baa911fc57e7f1220f9eb8f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga86b0c04e8baa911fc57e7f1220f9eb8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finalize the context after receiving.  <a href="#ga86b0c04e8baa911fc57e7f1220f9eb8f">More...</a><br /></td></tr>
<tr class="separator:ga86b0c04e8baa911fc57e7f1220f9eb8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9c251be717c7c4044dac7a79ecd6163a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga9c251be717c7c4044dac7a79ecd6163a">soap_begin_send</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga9c251be717c7c4044dac7a79ecd6163a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the context for sending.  <a href="#ga9c251be717c7c4044dac7a79ecd6163a">More...</a><br /></td></tr>
<tr class="separator:ga9c251be717c7c4044dac7a79ecd6163a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga290ddb46afdbf5ec6669b6ac8daca5c9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga290ddb46afdbf5ec6669b6ac8daca5c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finalize the context after sending.  <a href="#ga290ddb46afdbf5ec6669b6ac8daca5c9">More...</a><br /></td></tr>
<tr class="separator:ga290ddb46afdbf5ec6669b6ac8daca5c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga323e88327f1e0a1ce00b1428d7d9b4ba"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba">soap_begin_count</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga323e88327f1e0a1ce00b1428d7d9b4ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize context to count message length for sending.  <a href="#ga323e88327f1e0a1ce00b1428d7d9b4ba">More...</a><br /></td></tr>
<tr class="separator:ga323e88327f1e0a1ce00b1428d7d9b4ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2099fe49c19fb1409c31ec3d51fd8b4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4">soap_end_count</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gae2099fe49c19fb1409c31ec3d51fd8b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finalize context to count message length for sending.  <a href="#gae2099fe49c19fb1409c31ec3d51fd8b4">More...</a><br /></td></tr>
<tr class="separator:gae2099fe49c19fb1409c31ec3d51fd8b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06d59094afa3df6b1b9f6b2bb484207c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga06d59094afa3df6b1b9f6b2bb484207c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the socket connection.  <a href="#ga06d59094afa3df6b1b9f6b2bb484207c">More...</a><br /></td></tr>
<tr class="separator:ga06d59094afa3df6b1b9f6b2bb484207c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ca0c64dc76af8617956a62cf117db94"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga0ca0c64dc76af8617956a62cf117db94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Forcibly close the socket connection.  <a href="#ga0ca0c64dc76af8617956a62cf117db94">More...</a><br /></td></tr>
<tr class="separator:ga0ca0c64dc76af8617956a62cf117db94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga139afbf916c84724fef3f82aca4857d3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga139afbf916c84724fef3f82aca4857d3">soap_close_connection</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga139afbf916c84724fef3f82aca4857d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close the connection of the specified context using a self-pipe.  <a href="#ga139afbf916c84724fef3f82aca4857d3">More...</a><br /></td></tr>
<tr class="separator:ga139afbf916c84724fef3f82aca4857d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7712f5bc36127050a11ad995d0593bdc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *s)</td></tr>
<tr class="memdesc:ga7712f5bc36127050a11ad995d0593bdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a string.  <a href="#ga7712f5bc36127050a11ad995d0593bdc">More...</a><br /></td></tr>
<tr class="separator:ga7712f5bc36127050a11ad995d0593bdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab3b1ba631a0c47d67fe31474982bde86"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86">soap_send_raw</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, const char *s, size_t n)</td></tr>
<tr class="memdesc:gab3b1ba631a0c47d67fe31474982bde86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send raw bytes.  <a href="#gab3b1ba631a0c47d67fe31474982bde86">More...</a><br /></td></tr>
<tr class="separator:gab3b1ba631a0c47d67fe31474982bde86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a6ffc8733e72dfa63ece22ac9c077d3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga9a6ffc8733e72dfa63ece22ac9c077d3">soap_http_has_body</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga9a6ffc8733e72dfa63ece22ac9c077d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if HTTP body message is not empty.  <a href="#ga9a6ffc8733e72dfa63ece22ac9c077d3">More...</a><br /></td></tr>
<tr class="separator:ga9a6ffc8733e72dfa63ece22ac9c077d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2cd37f875d3314eec314b8723e2ffd8"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, size_t *len)</td></tr>
<tr class="memdesc:gae2cd37f875d3314eec314b8723e2ffd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the HTTP body message as a string.  <a href="#gae2cd37f875d3314eec314b8723e2ffd8">More...</a><br /></td></tr>
<tr class="separator:gae2cd37f875d3314eec314b8723e2ffd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f54c5916c6f6ddffec5d7120a230f46"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga3f54c5916c6f6ddffec5d7120a230f46">soap_getline</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, char *buf, int len)</td></tr>
<tr class="memdesc:ga3f54c5916c6f6ddffec5d7120a230f46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a header line.  <a href="#ga3f54c5916c6f6ddffec5d7120a230f46">More...</a><br /></td></tr>
<tr class="separator:ga3f54c5916c6f6ddffec5d7120a230f46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5cd5455317210135c78a04c45ed8f55"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gac5cd5455317210135c78a04c45ed8f55">soap_get0</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gac5cd5455317210135c78a04c45ed8f55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get next byte without consuming it.  <a href="#gac5cd5455317210135c78a04c45ed8f55">More...</a><br /></td></tr>
<tr class="separator:gac5cd5455317210135c78a04c45ed8f55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf9fb9f0468ed93132119bcf600b3b0a6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaf9fb9f0468ed93132119bcf600b3b0a6">soap_get1</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaf9fb9f0468ed93132119bcf600b3b0a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get next byte.  <a href="#gaf9fb9f0468ed93132119bcf600b3b0a6">More...</a><br /></td></tr>
<tr class="separator:gaf9fb9f0468ed93132119bcf600b3b0a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab331e9628197f71adb4caabacd20315e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gab331e9628197f71adb4caabacd20315e">soap_poll</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gab331e9628197f71adb4caabacd20315e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Poll the connection.  <a href="#gab331e9628197f71adb4caabacd20315e">More...</a><br /></td></tr>
<tr class="separator:gab331e9628197f71adb4caabacd20315e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga115be6d4b62bd840bd7750fde1bb73fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe">soap_ready</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga115be6d4b62bd840bd7750fde1bb73fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the connection is ready to receive pending data.  <a href="#ga115be6d4b62bd840bd7750fde1bb73fe">More...</a><br /></td></tr>
<tr class="separator:ga115be6d4b62bd840bd7750fde1bb73fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8bb9d541b641a6c261d8879363c7694c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga8bb9d541b641a6c261d8879363c7694c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive an HTTP response message from the server that is assumed to be empty.  <a href="#ga8bb9d541b641a6c261d8879363c7694c">More...</a><br /></td></tr>
<tr class="separator:ga8bb9d541b641a6c261d8879363c7694c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ac5e550072a59c8b6d432b63cc3543a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, int status)</td></tr>
<tr class="memdesc:ga6ac5e550072a59c8b6d432b63cc3543a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an HTTP response message with an empty HTTP body from a service back to the client or peer.  <a href="#ga6ac5e550072a59c8b6d432b63cc3543a">More...</a><br /></td></tr>
<tr class="separator:ga6ac5e550072a59c8b6d432b63cc3543a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb1779f009132aca606ad0fe33b41c04"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gacb1779f009132aca606ad0fe33b41c04">soap_envelope_begin_in</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gacb1779f009132aca606ad0fe33b41c04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the XML <em><code>&lt;SOAP-ENV:Envelope&gt;</code></em> element opening tag if present.  <a href="#gacb1779f009132aca606ad0fe33b41c04">More...</a><br /></td></tr>
<tr class="separator:gacb1779f009132aca606ad0fe33b41c04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a5df8f27327c7dc923264bac5bf1c16"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga5a5df8f27327c7dc923264bac5bf1c16">soap_envelope_end_in</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga5a5df8f27327c7dc923264bac5bf1c16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the XML <em><code>&lt;/SOAP-ENV:Envelope&gt;</code></em> element closing tag if present.  <a href="#ga5a5df8f27327c7dc923264bac5bf1c16">More...</a><br /></td></tr>
<tr class="separator:ga5a5df8f27327c7dc923264bac5bf1c16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaace2f3addda6f24c025289d76c12c119"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaace2f3addda6f24c025289d76c12c119">soap_envelope_begin_out</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaace2f3addda6f24c025289d76c12c119"><td class="mdescLeft">&#160;</td><td class="mdescRight">Emit the XML <em><code>&lt;SOAP-ENV:Envelope&gt;</code></em> element opening tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero.  <a href="#gaace2f3addda6f24c025289d76c12c119">More...</a><br /></td></tr>
<tr class="separator:gaace2f3addda6f24c025289d76c12c119"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3986d0f18df7c034b214e2b745545a97"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga3986d0f18df7c034b214e2b745545a97">soap_envelope_end_out</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga3986d0f18df7c034b214e2b745545a97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Emit the XML <em><code>&lt;/SOAP-ENV:Envelope&gt;</code></em> element closing tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero.  <a href="#ga3986d0f18df7c034b214e2b745545a97">More...</a><br /></td></tr>
<tr class="separator:ga3986d0f18df7c034b214e2b745545a97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf03f8d432c7849b8f52625cb1d483bc4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaf03f8d432c7849b8f52625cb1d483bc4">soap_body_begin_in</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaf03f8d432c7849b8f52625cb1d483bc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the XML <em><code>&lt;SOAP-ENV:Body&gt;</code></em> element opening tag if present.  <a href="#gaf03f8d432c7849b8f52625cb1d483bc4">More...</a><br /></td></tr>
<tr class="separator:gaf03f8d432c7849b8f52625cb1d483bc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa3fa118f5b72a71252aa5b0871fc188a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaa3fa118f5b72a71252aa5b0871fc188a">soap_body_end_in</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gaa3fa118f5b72a71252aa5b0871fc188a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the XML <em><code>&lt;/SOAP-ENV:Body&gt;</code></em> element closing tag if present.  <a href="#gaa3fa118f5b72a71252aa5b0871fc188a">More...</a><br /></td></tr>
<tr class="separator:gaa3fa118f5b72a71252aa5b0871fc188a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4a2c3dd294f013a36b98d1ac02321493"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga4a2c3dd294f013a36b98d1ac02321493">soap_body_begin_out</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga4a2c3dd294f013a36b98d1ac02321493"><td class="mdescLeft">&#160;</td><td class="mdescRight">Emit the XML <em><code>&lt;SOAP-ENV:Body&gt;</code></em> element opening tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero.  <a href="#ga4a2c3dd294f013a36b98d1ac02321493">More...</a><br /></td></tr>
<tr class="separator:ga4a2c3dd294f013a36b98d1ac02321493"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8efb262aa6c3df326565b29a842cf452"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga8efb262aa6c3df326565b29a842cf452">soap_body_end_out</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga8efb262aa6c3df326565b29a842cf452"><td class="mdescLeft">&#160;</td><td class="mdescRight">Emit the XML <em><code>&lt;/SOAP-ENV:Body&gt;</code></em> element closing tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero.  <a href="#ga8efb262aa6c3df326565b29a842cf452">More...</a><br /></td></tr>
<tr class="separator:ga8efb262aa6c3df326565b29a842cf452"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a9e19e214e19769e8e859ac631e5d63"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga1a9e19e214e19769e8e859ac631e5d63">soap_recv_fault</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, int check)</td></tr>
<tr class="memdesc:ga1a9e19e214e19769e8e859ac631e5d63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse and deserialize the SOAP Fault.  <a href="#ga1a9e19e214e19769e8e859ac631e5d63">More...</a><br /></td></tr>
<tr class="separator:ga1a9e19e214e19769e8e859ac631e5d63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab03e7a2c2605004c7f74be27738cc629"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gab03e7a2c2605004c7f74be27738cc629">soap_send_fault</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:gab03e7a2c2605004c7f74be27738cc629"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an HTTP error with a SOAP Fault message from a service.  <a href="#gab03e7a2c2605004c7f74be27738cc629">More...</a><br /></td></tr>
<tr class="separator:gab03e7a2c2605004c7f74be27738cc629"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga95afd0022acb20ad188ddbd5b54486dd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga95afd0022acb20ad188ddbd5b54486dd">soap_recv_header</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga95afd0022acb20ad188ddbd5b54486dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse and deserialize the SOAP Header.  <a href="#ga95afd0022acb20ad188ddbd5b54486dd">More...</a><br /></td></tr>
<tr class="separator:ga95afd0022acb20ad188ddbd5b54486dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07e242fefbde797cf9f76ff97f788334"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga07e242fefbde797cf9f76ff97f788334">soap_putheader</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga07e242fefbde797cf9f76ff97f788334"><td class="mdescLeft">&#160;</td><td class="mdescRight">Emit the SOAP Header pointed to by <code><a class="el" href="structsoap.html#ac091dfe4e01b6a082d916c381e7006ba" title="The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...">soap::header</a></code>  <a href="#ga07e242fefbde797cf9f76ff97f788334">More...</a><br /></td></tr>
<tr class="separator:ga07e242fefbde797cf9f76ff97f788334"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3096038c328d84f90d54e156f9cb46f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga3096038c328d84f90d54e156f9cb46f6">soap_serializeheader</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga3096038c328d84f90d54e156f9cb46f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize the SOAP Header pointed to by <code><a class="el" href="structsoap.html#ac091dfe4e01b6a082d916c381e7006ba" title="The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...">soap::header</a></code> before emitting it with <code><a class="el" href="group__group__io.html#ga07e242fefbde797cf9f76ff97f788334" title="Emit the SOAP Header pointed to by soap::header ">soap_putheader</a></code>  <a href="#ga3096038c328d84f90d54e156f9cb46f6">More...</a><br /></td></tr>
<tr class="separator:ga3096038c328d84f90d54e156f9cb46f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ecdc43a53e494edc4f84e8c135659ba"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba">http_get</a> (struct <a class="el" href="structsoap.html">soap</a> *, struct soap_plugin *, void *)</td></tr>
<tr class="memdesc:ga0ecdc43a53e494edc4f84e8c135659ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">The HTTP GET plugin registration function.  <a href="#ga0ecdc43a53e494edc4f84e8c135659ba">More...</a><br /></td></tr>
<tr class="separator:ga0ecdc43a53e494edc4f84e8c135659ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafee768c3e45ee451c4cd6907e446c888"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gafee768c3e45ee451c4cd6907e446c888">soap_http_get_stats</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, size_t *stat_get, size_t *stat_post, size_t *stat_fail, size_t **hist_min, size_t **hist_hour, size_t **hist_day)</td></tr>
<tr class="memdesc:gafee768c3e45ee451c4cd6907e446c888"><td class="mdescLeft">&#160;</td><td class="mdescRight">Collect access statistics with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.  <a href="#gafee768c3e45ee451c4cd6907e446c888">More...</a><br /></td></tr>
<tr class="separator:gafee768c3e45ee451c4cd6907e446c888"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a84b61777a04a066e6e11baa89c579b"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga6a84b61777a04a066e6e11baa89c579b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the query string from the URL path at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.  <a href="#ga6a84b61777a04a066e6e11baa89c579b">More...</a><br /></td></tr>
<tr class="separator:ga6a84b61777a04a066e6e11baa89c579b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae803685e32f840798dd5845eba176dc5"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, char **query)</td></tr>
<tr class="memdesc:gae803685e32f840798dd5845eba176dc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the next query string key at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.  <a href="#gae803685e32f840798dd5845eba176dc5">More...</a><br /></td></tr>
<tr class="separator:gae803685e32f840798dd5845eba176dc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba1919e769e74b32ea8726e012cbdb86"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86">soap_query_val</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>, char **query)</td></tr>
<tr class="memdesc:gaba1919e769e74b32ea8726e012cbdb86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the next query string value at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.  <a href="#gaba1919e769e74b32ea8726e012cbdb86">More...</a><br /></td></tr>
<tr class="separator:gaba1919e769e74b32ea8726e012cbdb86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c08d5ef28bc0dc37eee4633acdd1140"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140">http_post</a> (struct <a class="el" href="structsoap.html">soap</a> *, struct soap_plugin *, void *)</td></tr>
<tr class="memdesc:ga4c08d5ef28bc0dc37eee4633acdd1140"><td class="mdescLeft">&#160;</td><td class="mdescRight">The HTTP POST plugin registration function.  <a href="#ga4c08d5ef28bc0dc37eee4633acdd1140">More...</a><br /></td></tr>
<tr class="separator:ga4c08d5ef28bc0dc37eee4633acdd1140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga85c7fe6ae796534e2f54678c014c507c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c">http_form</a> (struct <a class="el" href="structsoap.html">soap</a> *, struct soap_plugin *, void *)</td></tr>
<tr class="memdesc:ga85c7fe6ae796534e2f54678c014c507c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The HTTP POST form plugin registration function.  <a href="#ga85c7fe6ae796534e2f54678c014c507c">More...</a><br /></td></tr>
<tr class="separator:ga85c7fe6ae796534e2f54678c014c507c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2fffac56a74407e77762dd2ff9c761fa"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#ga2fffac56a74407e77762dd2ff9c761fa">soap_http_get_form</a> (struct <a class="el" href="structsoap.html">soap</a> *<a class="el" href="structsoap.html">soap</a>)</td></tr>
<tr class="memdesc:ga2fffac56a74407e77762dd2ff9c761fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the HTTP POST application/x-www-form-urlencoded data as a string.  <a href="#ga2fffac56a74407e77762dd2ff9c761fa">More...</a><br /></td></tr>
<tr class="separator:ga2fffac56a74407e77762dd2ff9c761fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabebc40cb4df7641874965df27cfd7abc"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__io.html#gabebc40cb4df7641874965df27cfd7abc">http_pipe</a> (struct <a class="el" href="structsoap.html">soap</a> *, struct soap_plugin *, void *)</td></tr>
<tr class="memdesc:gabebc40cb4df7641874965df27cfd7abc"><td class="mdescLeft">&#160;</td><td class="mdescRight">The HTTP pipelining plugin registration function.  <a href="#gabebc40cb4df7641874965df27cfd7abc">More...</a><br /></td></tr>
<tr class="separator:gabebc40cb4df7641874965df27cfd7abc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This module defines functions for HTTP operations and functions for receiving and sending data. </p>
<p>This module defines the following client-side functions:</p><ul>
<li><code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code></li>
<li><code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga5c87e9d0a43fe18cc349c724f198f64a" title="Connect to a server using HTTP POST. ">soap_connect</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c" title="Receive an HTTP response message from the server that is assumed to be empty. ">soap_recv_empty_response</a></code></li>
</ul>
<p>This module defines the following server-side functions:</p><ul>
<li><code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code></li>
<li><code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code> (defined in the <a class="el" href="group__group__ssl.html">SSL/TLS context and functions</a> module)</li>
<li><code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> (generated by soapcpp2)</li>
<li><code><a class="el" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb" title="Initiates serving a pending client request. ">soap_begin_serve</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga4e138b90120efda4a1259d93d79bd2ad" title="Process a pending request. ">soap_serve_request</a></code> (generated by soapcpp2)</li>
<li><code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a" title="Return an HTTP response message with an empty HTTP body from a service back to the client or peer...">soap_send_empty_response</a></code></li>
</ul>
<p>This module defines the following input/output functions:</p><ul>
<li><code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f" title="Finalize the context after receiving. ">soap_end_recv</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga9c251be717c7c4044dac7a79ecd6163a" title="Initialize the context for sending. ">soap_begin_send</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9" title="Finalize the context after sending. ">soap_end_send</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code></li>
<li><code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c" title="Close the socket connection. ">soap_closesock</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94" title="Forcibly close the socket connection. ">soap_force_closesock</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga139afbf916c84724fef3f82aca4857d3" title="Close the connection of the specified context using a self-pipe. ">soap_close_connection</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc" title="Send a string. ">soap_send</a></code></li>
<li><code><a class="el" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86" title="Send raw bytes. ">soap_send_raw</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga9a6ffc8733e72dfa63ece22ac9c077d3" title="Check if HTTP body message is not empty. ">soap_http_has_body</a></code></li>
<li><code><a class="el" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8" title="Get the HTTP body message as a string. ">soap_http_get_body</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga3f54c5916c6f6ddffec5d7120a230f46" title="Get a header line. ">soap_getline</a></code></li>
<li><code><a class="el" href="group__group__io.html#gac5cd5455317210135c78a04c45ed8f55" title="Get next byte without consuming it. ">soap_get0</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaf9fb9f0468ed93132119bcf600b3b0a6" title="Get next byte. ">soap_get1</a></code></li>
<li><code><a class="el" href="group__group__io.html#gab331e9628197f71adb4caabacd20315e" title="Poll the connection. ">soap_poll</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe" title="Check if the connection is ready to receive pending data. ">soap_ready</a></code></li>
</ul>
<p>This module defines the following SOAP message input/output functions:</p><ul>
<li><code><a class="el" href="group__group__io.html#gacb1779f009132aca606ad0fe33b41c04" title="Parse the XML &lt;SOAP-ENV:Envelope&gt; element opening tag if present. ">soap_envelope_begin_in</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga5a5df8f27327c7dc923264bac5bf1c16" title="Parse the XML &lt;/SOAP-ENV:Envelope&gt; element closing tag if present. ">soap_envelope_end_in</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaace2f3addda6f24c025289d76c12c119" title="Emit the XML &lt;SOAP-ENV:Envelope&gt; element opening tag if soap::version is nonzero. ...">soap_envelope_begin_out</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga3986d0f18df7c034b214e2b745545a97" title="Emit the XML &lt;/SOAP-ENV:Envelope&gt; element closing tag if soap::version is nonzero. ">soap_envelope_end_out</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaf03f8d432c7849b8f52625cb1d483bc4" title="Parse the XML &lt;SOAP-ENV:Body&gt; element opening tag if present. ">soap_body_begin_in</a></code></li>
<li><code><a class="el" href="group__group__io.html#gaa3fa118f5b72a71252aa5b0871fc188a" title="Parse the XML &lt;/SOAP-ENV:Body&gt; element closing tag if present. ">soap_body_end_in</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga4a2c3dd294f013a36b98d1ac02321493" title="Emit the XML &lt;SOAP-ENV:Body&gt; element opening tag if soap::version is nonzero. ">soap_body_begin_out</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga8efb262aa6c3df326565b29a842cf452" title="Emit the XML &lt;/SOAP-ENV:Body&gt; element closing tag if soap::version is nonzero. ">soap_body_end_out</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga1a9e19e214e19769e8e859ac631e5d63" title="Parse and deserialize the SOAP Fault. ">soap_recv_fault</a></code></li>
<li><code><a class="el" href="group__group__io.html#gab03e7a2c2605004c7f74be27738cc629" title="Return an HTTP error with a SOAP Fault message from a service. ">soap_send_fault</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga95afd0022acb20ad188ddbd5b54486dd" title="Parse and deserialize the SOAP Header. ">soap_recv_header</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga07e242fefbde797cf9f76ff97f788334" title="Emit the SOAP Header pointed to by soap::header ">soap_putheader</a></code></li>
<li><code><a class="el" href="group__group__io.html#ga3096038c328d84f90d54e156f9cb46f6" title="Serialize the SOAP Header pointed to by soap::header before emitting it with soap_putheader ...">soap_serializeheader</a></code></li>
</ul>
<p>This module defines three HTTP-related plugins;</p><ul>
<li><code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> HTTP GET plugin for server-side handling of HTTP GET requests by stand-alone servers as a more capable alternative to setting the <code><a class="el" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16" title="Callback to implement logic at the server-side to serve responses to HTTP GET requests from clients...">soap::fget</a></code> callback.</li>
<li><code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code> HTTP POST plugin for server-side handling of HTTP POST, PUT, PATCH, and DELETE request by stand-alone servers as a more capable alternative to setting the <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>, <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>, and <code><a class="el" href="group__group__callbacks.html#gaf2bda0187489c8f2b9857f61b96ad0e0" title="Callback to implement logic at the server-side to serve responses to HTTP DELETE requests from client...">soap::fdel</a></code> callbacks.</li>
<li><code><a class="el" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c" title="The HTTP POST form plugin registration function. ">http_form</a></code> HTTP POST form plugin for server-side handling of HTTP application/x-www-form-urlencoded data.</li>
<li><code><a class="el" href="group__group__io.html#gabebc40cb4df7641874965df27cfd7abc" title="The HTTP pipelining plugin registration function. ">http_pipe</a></code> HTTP pipelining plugin to support server-side and client-side pipelined HTTP messages. </li>
</ul>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gaaf0409312a4af954ee5b183b92967e0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_CONNECT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP CONNECT command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. </p>

</div>
</div>
<a class="anchor" id="ga6e1b491acf772e88f64909ee5baae18d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_DEL</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP DEL command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. The <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code> performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga6e1b491acf772e88f64909ee5baae18d" title="HTTP DEL command code. ">SOAP_DEL</a></code>. <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code> is recommended.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/DELETE&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga6e1b491acf772e88f64909ee5baae18d">SOAP_DEL</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga05be99343f556fe70940145e874cdb99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_FILE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A special <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code to signal that a custom file-based HTTP response is present and no HTTP response must be produced. </p>
<p>This code is used with <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code> to return a file-based response message with a HTTP content type specified by the <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string variable. The <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code> function normally returns HTTP 200 OK, but the HTTP status code can be specified as <code><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99" title="A special soap_status error code to signal that a custom file-based HTTP response is present and no H...">SOAP_FILE</a> + status</code> where <code>status</code> is a HTTP status code between 200 and 599. </p>

</div>
</div>
<a class="anchor" id="ga3abcdd760843c4bdc56c19b85453ed04"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_GET</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP GET command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. The <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code> performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04" title="HTTP GET command code. ">SOAP_GET</a></code>. <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code> is recommended.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/GET&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04">SOAP_GET</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga31ba86b35e83440e4047b021add6fe2c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_HEAD</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP HEAD command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. </p>

</div>
</div>
<a class="anchor" id="ga17cdc287dd916e5d2b3467ccec177d5a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_HTML</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A special <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code to signal that a custom HTTP response is present and no HTTP response must be produced. </p>
<p>This code is used with <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code> to return a HTML response message with a HTTP content type "text/html". </p>

</div>
</div>
<a class="anchor" id="gab85d36efa8017c3d328289e25318fb18"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_OPTIONS</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP OPTIONS command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. </p>

</div>
</div>
<a class="anchor" id="ga0f6661cfe8eff845600e7a75a2f46701"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_PATCH</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP PATCH command code with custom content type. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> and requires <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> to be set to the content type of the data to be sent. The <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code> function performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701" title="HTTP PATCH command code with custom content type. ">SOAP_PATCH</a></code>. <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code> is recommended.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/PATCH&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701">SOAP_PATCH</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga41f39e73106f1a2283ae3aa65698050f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_POST</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP POST command code. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> and produces HTTP content type <code>text/xml; charset=utf-8</code>. Use code <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code> to customize the content type by setting <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code>. Before calling <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>, either the HTTP content length <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> must be determined with <code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code> and <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, or the mode of the context should be set to <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code>. The <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code> function performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code> and sets the context mode to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> when required. <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code> is recommended.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="comment">// HTTP GET</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <a class="code" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04">SOAP_GET</a>, <a class="code" href="structsoap.html#aed1b86b8a34aea86103751a932c9dce9">endpoint</a>, NULL)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// must use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="comment">// HTTP POST request with chunked transfer</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <a class="code" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f">SOAP_POST</a>, <a class="code" href="structsoap.html#aed1b86b8a34aea86103751a932c9dce9">endpoint</a>, NULL)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>(); <span class="comment">// no SOAP_IO_CHUNK or SOAP_IO_STORE, see below</span></div><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *request = <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>;</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="comment">// HTTP POST request, here we compute the content length instead of chunked transfer with SOAP_IO_CHUNK or storing the entire message with SOAP_IO_STORE</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba">soap_begin_count</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4">soap_end_count</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <a class="code" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f">SOAP_POST</a>, <a class="code" href="structsoap.html#aed1b86b8a34aea86103751a932c9dce9">endpoint</a>, NULL)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code> </dd></dl>

</div>
</div>
<a class="anchor" id="ga4c291263eadcefa290e90c64e632ae47"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_POST_FILE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP POST command code with custom content type. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> and requires <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> to be set to the content type of the data to be sent. Before calling <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>, either the HTTP content length <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> must be determined with <code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code> and <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, or the mode of the context should be set to <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code>. The <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code> function performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code> and sets the context mode to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> when required. <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code> is recommended.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK (preferred) or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line">soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47">SOAP_POST_FILE</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga32a114ef8df190363b9c3ad37bcb6335"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SOAP_PUT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP PUT command code with custom content type. </p>
<p>This code is to be used with <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> and requires <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> to be set to the content type of the data to be sent. The <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code> performs the same operation as <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335" title="HTTP PUT command code with custom content type. ">SOAP_PUT</a></code> and is recommended.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;text/xml; charset=utf-8&quot;</span>;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/PUT&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335">SOAP_PUT</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --> 
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga3b89c45fdd4914818fde0fd30013335e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e">soap_http_command</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP command methods for <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> </p>
<p>The choice of options are: <code><a class="el" href="group__group__io.html#gaaf0409312a4af954ee5b183b92967e0b" title="HTTP CONNECT command code. ">SOAP_CONNECT</a></code> <code><a class="el" href="group__group__io.html#ga6e1b491acf772e88f64909ee5baae18d" title="HTTP DEL command code. ">SOAP_DEL</a></code> <code><a class="el" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04" title="HTTP GET command code. ">SOAP_GET</a></code> <code><a class="el" href="group__group__io.html#ga31ba86b35e83440e4047b021add6fe2c" title="HTTP HEAD command code. ">SOAP_HEAD</a></code> <code><a class="el" href="group__group__io.html#gab85d36efa8017c3d328289e25318fb18" title="HTTP OPTIONS command code. ">SOAP_OPTIONS</a></code> <code><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701" title="HTTP PATCH command code with custom content type. ">SOAP_PATCH</a></code> <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code> <code><a class="el" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f" title="HTTP POST command code. ">SOAP_POST</a></code> <code><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335" title="HTTP PUT command code with custom content type. ">SOAP_PUT</a></code> </p>

</div>
</div>
<a class="anchor" id="ga0c7ca927c25cf2e5f03d0add91b3eb6d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int32_t <a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wide char type. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga85c7fe6ae796534e2f54678c014c507c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int http_form </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The HTTP POST form plugin registration function. </p>
<p>This function is used to register the <code><a class="el" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c" title="The HTTP POST form plugin registration function. ">http_form</a></code> HTTP POST form plugin to handle application/x-www-form-urlencoded data with <code>soap_register_plugin_arg(soap, http_form, http_form_handler)</code> where the <code>http_form_handler</code> is a function to parse the application/x-www-form-urlencoded data received by the server. The HTTP POST form plugin API is declared and defined in <em><code>gsoap/plugin/httpform.h</code></em> and <em><code>gsoap/plugin/httpform.c</code></em>.</p>
<p>Handling multipart/related and multipart/form-data at the server side is done by iterating over the <code><a class="el" href="structsoap__multipart.html" title="DIME/MIME/MTOM attachment data received by the engine. ">soap_multipart</a></code> linked list containing the MIME attachments received, see the detailed description of <a class="el" href="group__group__mime.html">MIME attachment functions</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This plugin requires the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin for the <code><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5" title="Extract the next query string key at the server side with the http_get plugin. ">soap_query_key</a></code> and <code><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86" title="Extract the next query string value at the server side with the http_get plugin. ">soap_query_val</a></code> functions.</dd></dl>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httpform.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <a class="code" href="group__group__plugin.html#ga800a005ce0f0236461d1a5dbf4be2a80">soap_register_plugin_arg</a>(soap, <a class="code" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c">http_form</a>, http_form_handler);</div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> http_form_handler(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordflow">if</span> (!strncmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/API/FORM&quot;</span>, 9))</div><div class="line">  {</div><div class="line">    <span class="comment">// get the application/x-www-form-urlencoded data</span></div><div class="line">    <span class="keywordtype">char</span> *form = <a class="code" href="group__group__io.html#ga2fffac56a74407e77762dd2ff9c761fa">soap_http_get_form</a>(soap); </div><div class="line">    <span class="keywordflow">while</span> (form)</div><div class="line">    {</div><div class="line">      <span class="comment">// get next key=val pair</span></div><div class="line">      <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;form);</div><div class="line">      <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;form);</div><div class="line">      ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">    }</div><div class="line">    <span class="comment">// return a response message</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga17cdc287dd916e5d2b3467ccec177d5a">SOAP_HTML</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;html&gt;&lt;body&gt;Thank you for submitting&lt;/body&gt;&lt;/html&gt;\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="keywordflow">return</span> 404; <span class="comment">// HTTP 404 Not Found</span></div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga2fffac56a74407e77762dd2ff9c761fa" title="Get the HTTP POST application/x-www-form-urlencoded data as a string. ">soap_http_get_form</a></code>, <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code>, <code><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5" title="Extract the next query string key at the server side with the http_get plugin. ">soap_query_key</a></code>, <code><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86" title="Extract the next query string value at the server side with the http_get plugin. ">soap_query_val</a></code>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga0ecdc43a53e494edc4f84e8c135659ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int http_get </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The HTTP GET plugin registration function. </p>
<p>This function is used to register the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> HTTP GET plugin with <code>soap_register_plugin_arg(soap, http_get, http_get_handler)</code> where the <code>http_get_handler</code> is a user-defined function to handle HTTP GET requests. The HTTP GET plugin API is declared and defined in <em><code>gsoap/plugin/httpget.h</code></em> and <em><code>gsoap/plugin/httpget.c</code></em>. The <code><a class="el" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309" title="The client request path as received on the server side. ">soap::path</a></code> string contains the URL path, starting with a leading <code>/</code>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httpget.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <a class="code" href="group__group__plugin.html#ga800a005ce0f0236461d1a5dbf4be2a80">soap_register_plugin_arg</a>(soap, <a class="code" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba">http_get</a>, http_get_handler);</div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> http_get_handler(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordflow">if</span> (!strncmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/API/GET&quot;</span>, 8))</div><div class="line">  {</div><div class="line">    <span class="comment">// get the query key=val pairs from soap-&gt;path</span></div><div class="line">    <span class="keywordtype">char</span> *query = <a class="code" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a>(soap); </div><div class="line">    <span class="keywordflow">while</span> (query)</div><div class="line">    {</div><div class="line">      <span class="comment">// get next key=val pair</span></div><div class="line">      <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">      <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">      ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">    }</div><div class="line">    <span class="comment">// return a response message</span></div><div class="line">    soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="keywordflow">return</span> 404; <span class="comment">// HTTP 404 Not Found</span></div><div class="line">}</div></div><!-- fragment --><dl class="section warning"><dt>Warning</dt><dd>When serving files as responses to requests, we need to be vary careful, because we don't want requests to snoop around in directories and serve files that should be protected from public view. Therefore, when adding logic to serve files, we must reject request that have <code><a class="el" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309" title="The client request path as received on the server side. ">soap::path</a></code> values with a <code>/</code> or a <code>\</code> . If these are allowed, then we must at least check for <code>..</code> in the path to avoid request from snooping around in higher directories all the way up to the root. See the <em><code>gsoap/samples/webserver/webserver.c</code></em> example for details.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#gafee768c3e45ee451c4cd6907e446c888" title="Collect access statistics with the http_get plugin. ">soap_http_get_stats</a></code>, <code><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b" title="Extract the query string from the URL path at the server side with the http_get plugin. ">soap_query</a></code>, <code><a class="el" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16" title="Callback to implement logic at the server-side to serve responses to HTTP GET requests from clients...">soap::fget</a></code>. </dd></dl>

</div>
</div>
<a class="anchor" id="gabebc40cb4df7641874965df27cfd7abc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int http_pipe </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The HTTP pipelining plugin registration function. </p>
<p>This function is used to register the <code><a class="el" href="group__group__io.html#gabebc40cb4df7641874965df27cfd7abc" title="The HTTP pipelining plugin registration function. ">http_pipe</a></code> HTTP pipelining plugin to support HTTP pipelining. HTTP pipelining requires <code><a class="el" href="group__group__flags.html#ga0a4635737732c912058ff4dba668c1b2" title="soap_mode IO input and output flag value to keep the socket connection alive for SOAP_MAXKEEPALIVE me...">SOAP_IO_KEEPALIVE</a></code> enabled. At the server side, multiple threads should be used to serve requests, such as with a gSOAP multi-threaded stand-alone server. HTTP pipelining at the client side requires two threads, one to send request messages and one to receive the response messages, with logic to handle transmission errors and to resend failed request messages until all responses have been received.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httppipe.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/threads.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#ga0a4635737732c912058ff4dba668c1b2">SOAP_IO_KEEPALIVE</a>); <span class="comment">// HTTP keep-alive</span></div><div class="line">  <a class="code" href="group__group__plugin.html#gad645e5a58ed442fe4753dcc2338c8bdb">soap_register_plugin</a>(soap, <a class="code" href="group__group__io.html#gabebc40cb4df7641874965df27cfd7abc">http_pipe</a>);            <span class="comment">// HTTP pipelining</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59">bind_flags</a> = SO_REUSEADDR;                  <span class="comment">// immediate port reuse</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                      <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5;       <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                      <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;                   <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__threads.html#ga53ca774b0fc84afe282a5419d2d7239a">THREAD_TYPE</a> tid;</div><div class="line">        <span class="keyword">struct </span>soap *tsoap = <a class="code" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a">soap_copy</a>(soap);</div><div class="line">        <span class="keywordflow">if</span> (!tsoap)</div><div class="line">          <a class="code" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a>(soap);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">          <span class="keywordflow">while</span> (<a class="code" href="group__group__threads.html#gabee88cce937a2709b4799ed8df36d486">THREAD_CREATE</a>(&amp;tid, (<span class="keywordtype">void</span>*(*)(<span class="keywordtype">void</span>*))&amp;process_request, (<span class="keywordtype">void</span>*)tsoap))</div><div class="line">            sleep(1); <span class="comment">// failed, try again</span></div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *process_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__threads.html#ga5848fc7adb50b3a15e40955dce7f8f53">THREAD_DETACH</a>(<a class="code" href="group__group__threads.html#ga9ab5a77b8cf2b98f7d6c1b48bb421f69">THREAD_ID</a>);</div><div class="line">  <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga4c08d5ef28bc0dc37eee4633acdd1140"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int http_post </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct soap_plugin *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The HTTP POST plugin registration function. </p>
<p>This function is used to register the <code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code> HTTP POST plugin with <code>soap_register_plugin_arg(soap, http_post, http_post_handler)</code> where the <code>http_post_handler</code> is a table of HTTP POST handler functions and generic POST, PUT, PATCH, and DELETE handler functions. The HTTP POST plugin API is declared and defined in <em><code>gsoap/plugin/httppost.h</code></em> and <em><code>gsoap/plugin/httppost.c</code></em>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httppost.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <a class="code" href="group__group__plugin.html#ga800a005ce0f0236461d1a5dbf4be2a80">soap_register_plugin_arg</a>(soap, <a class="code" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140">http_post</a>, http_post_handlers);</div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keyword">struct </span>http_post_handlers http_post_handlers[] = {</div><div class="line">  { <span class="stringliteral">&quot;application/json&quot;</span>,   json_post_handler },</div><div class="line">  { <span class="stringliteral">&quot;image/*&quot;</span>,            image_post_handler },</div><div class="line">  { <span class="stringliteral">&quot;text/*&quot;</span>,             text_post_handler },</div><div class="line">  { <span class="stringliteral">&quot;POST&quot;</span>,               generic_POST_handler },</div><div class="line">  { <span class="stringliteral">&quot;PUT&quot;</span>,                generic_PUT_handler },</div><div class="line">  { <span class="stringliteral">&quot;PATCH&quot;</span>,              generic_PATCH_handler },</div><div class="line">  { <span class="stringliteral">&quot;DELETE&quot;</span>,             generic_DELETE_handler },</div><div class="line">  { NULL }</div><div class="line">};</div><div class="line"><span class="comment">// example image/* POST handler</span></div><div class="line"><span class="comment">// note: json_post_handler and text_post_handler are similar to this example</span></div><div class="line"><span class="keywordtype">int</span> image_post_handler(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> *buf;</div><div class="line">  <span class="keywordtype">size_t</span> len;</div><div class="line">  <span class="comment">// for example, only handle /API/POST paths and content type image/gif</span></div><div class="line">  <span class="keywordflow">if</span> (!strncmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/API/POST&quot;</span>, 9))</div><div class="line">   || (soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> &amp;&amp; <a class="code" href="group__group__misc.html#gae2bfad49979faa3a625aca44acaa017c">soap_tag_cmp</a>(soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a>, <span class="stringliteral">&quot;image/gif&quot;</span>)))</div><div class="line">    <span class="keywordflow">return</span> 404;</div><div class="line">  <span class="comment">// get HTTP POST message body</span></div><div class="line">  buf = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;len);</div><div class="line">  <span class="keywordflow">if</span> (!buf)</div><div class="line">    <span class="keywordflow">return</span> 400; <span class="comment">// HTTP 400 Bad Request</span></div><div class="line">  (void)<a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap);</div><div class="line">  ... <span class="comment">// process image in buf[0..len-1]</span></div><div class="line">  <span class="comment">// for example, send image back (HTTP POST returns a response message)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;image/gif&quot;</span>;</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a>)</div><div class="line">   || <a class="code" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86">soap_send_raw</a>(soap, buf, len)</div><div class="line">   || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div><div class="line"><span class="comment">// example generic PUT handler</span></div><div class="line"><span class="keywordtype">int</span> generic_PUT_handler(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> *buf;</div><div class="line">  <span class="keywordtype">size_t</span> len;</div><div class="line">  <span class="comment">// for example, only handle /API/PUT paths and content type image/gif</span></div><div class="line">  <span class="keywordflow">if</span> (!strncmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/API/PUT&quot;</span>, 8))</div><div class="line">   || (soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> &amp;&amp; <a class="code" href="group__group__misc.html#gae2bfad49979faa3a625aca44acaa017c">soap_tag_cmp</a>(soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a>, <span class="stringliteral">&quot;image/gif&quot;</span>)))</div><div class="line">    <span class="keywordflow">return</span> 404;</div><div class="line">  <span class="comment">// get HTTP PUT message body</span></div><div class="line">  buf = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;len);</div><div class="line">  <span class="keywordflow">if</span> (!buf)</div><div class="line">    <span class="keywordflow">return</span> 400; <span class="comment">// HTTP 400 Bad Request</span></div><div class="line">  (void)<a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap);</div><div class="line">  ... <span class="comment">// process image in buf[0..len-1]</span></div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a>(soap, 200); <span class="comment">// HTTP 200 OK</span></div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="gaec0e1aecc2d5479d8099762feb4713c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__soap.html#ga6eb1bde7cecc2fbadbcbbc6395227439">SOAP_SOCKET</a> soap_accept </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accept a connection with a client. </p>
<p>This function accepts a connection requested by a client on a given port that is bound with <code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code> first to set <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code>. To accept HTTPS connections, call <code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code> after this function to perform the HTTPS handshake with the client. Returns the <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> connected to the client or the invalid socket handle <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> when an error occurred.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap))</div><div class="line">          <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/threads.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59">bind_flags</a> = SO_REUSEADDR;            <span class="comment">// immediate port reuse</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__threads.html#ga53ca774b0fc84afe282a5419d2d7239a">THREAD_TYPE</a> tid;</div><div class="line">        <span class="keyword">struct </span>soap *tsoap = <a class="code" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a">soap_copy</a>(soap);</div><div class="line">        <span class="keywordflow">if</span> (!tsoap)</div><div class="line">          <a class="code" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a>(soap);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">          <span class="keywordflow">while</span> (<a class="code" href="group__group__threads.html#gabee88cce937a2709b4799ed8df36d486">THREAD_CREATE</a>(&amp;tid, (<span class="keywordtype">void</span>*(*)(<span class="keywordtype">void</span>*))&amp;process_request, (<span class="keywordtype">void</span>*)tsoap))</div><div class="line">            sleep(1); <span class="comment">// failed, try again</span></div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *process_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__threads.html#ga5848fc7adb50b3a15e40955dce7f8f53">THREAD_DETACH</a>(<a class="code" href="group__group__threads.html#ga9ab5a77b8cf2b98f7d6c1b48bb421f69">THREAD_ID</a>);</div><div class="line">  <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">// alternative process_request function to accept HTTPS connections</span></div><div class="line"><span class="keywordtype">void</span> *process_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__threads.html#ga5848fc7adb50b3a15e40955dce7f8f53">THREAD_DETACH</a>(<a class="code" href="group__group__threads.html#ga9ab5a77b8cf2b98f7d6c1b48bb421f69">THREAD_ID</a>);</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc">soap_ssl_accept</a>(soap) == <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">    <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__with.html#ga40cbd680e7dbdeb63bce1d6d4b7b9620" title="When this macro is defined at compile time (undefined by default), IPv6 support is enabled and both I...">WITH_IPV6</a></code>, <code><a class="el" href="group__group__with.html#ga2854fe8474c2f87a9916d892306cb94c" title="When this macro is defined at compile time (undefined by default), IPv6-only is enabled for port bind...">WITH_IPV6_V6ONLY</a></code>, <code><a class="el" href="group__group__flags.html#ga388dae9abc80cd6f6d0ecfba383da03b" title="soap_mode IO input/output flag value to use UDP datagrams, message size is limited to UDP packet size...">SOAP_IO_UDP</a></code>, <code><a class="el" href="structsoap.html#ad98f12f602efdde049dbd367a43e7cb0" title="User-definable setsockopt level SOL_SOCKET flags (0 by default), when nonzero sets the soap::socket f...">soap::accept_flags</a></code>, <code><a class="el" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59" title="User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by ...">soap::bind_flags</a></code>, <code><a class="el" href="structsoap.html#a08f1b076f0f041cdf89b9a969520fd4a" title="User-definable flag, when nonzero uses AF_INET6 instead of PF_UNSPEC when binding the soap::master so...">soap::bind_inet6</a></code>, <code><a class="el" href="structsoap.html#a90e04027ea9efa26e550f5438ab9f3d6" title="User-definable flag, when nonzero enables IPPROTO_IPV6 setsockopt IPV6_V6ONLY when binding the soap::...">soap::bind_v6only</a></code>, <code><a class="el" href="structsoap.html#af2b1fc40a14f7ed925658246a26497c8" title="User-definable value to set SO_RCVBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::rcvbuf</a></code>, <code><a class="el" href="structsoap.html#a02a7fffd05ff6e6c751f2033ef83854f" title="User-definable value to set SO_SNDBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::sndbuf</a></code>, <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code>, <code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code>, <code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> value or <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> when an error occurred (check the return value with <code><a class="el" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c" title="Function macro to check if a socket is valid, i.e. not equal to SOAP_INVALID_SOCKET ...">soap_valid_socket</a></code>) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga323e88327f1e0a1ce00b1428d7d9b4ba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_begin_count </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize context to count message length for sending. </p>
<p>This function is used to determine the HTTP content length. This is done by sending the message after calling this function to update <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code>. To activate message length counting the <code><a class="el" href="group__group__flags.html#gae27399f26b6a31d91b6884b957925c3e" title="soap_mode IO output flag value to calculate message length when sending a message without transmissio...">SOAP_IO_LENGTH</a></code> mode is enabled, which prevents the message from being sent by not passing the data to the (internal) <code><a class="el" href="group__group__callbacks.html#gafd52b80655e4f1021edd6c55b8dfedff" title="Callback that sends the given bytes of data. ">soap::fsend</a></code> callback. HTTP requires either the HTTP content length header or HTTP transfer encoding chunked with <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code>. Alternatively, the mode of the context can be set to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to buffer the entire message in memory to determine the message content length.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *request = <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>;</div><div class="line"><span class="comment">// HTTP POST request, soap_POST stores the entire message with SOAP_IO_STORE to determine HTTP content length</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2">soap_POST</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">soap-&gt;<a class="code" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16">fget</a> = my_get; <span class="comment">// HTTP GET handler to serve HTTP GET</span></div><div class="line">... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> my_get(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="comment">// serve HTTP GET request, here we compute the content length instead of chunked transfer with SOAP_IO_CHUNK or storing the entire message with SOAP_IO_STORE</span></div><div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> *response = <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>;</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba">soap_begin_count</a>(soap)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, response)</div><div class="line">   || <a class="code" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4">soap_end_count</a>(soap)</div><div class="line">   || <a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, response)</div><div class="line">   || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><p>Same examples but using HTTP transfer encoding chunked:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>);</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *request = <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2">soap_POST</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>);</div><div class="line">soap-&gt;<a class="code" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16">fget</a> = my_get; <span class="comment">// HTTP GET handler to serve HTTP GET</span></div><div class="line">... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> my_get(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> *response = <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>;</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, response)</div><div class="line">   || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, <code><a class="el" href="group__group__flags.html#gae27399f26b6a31d91b6884b957925c3e" title="soap_mode IO output flag value to calculate message length when sending a message without transmissio...">SOAP_IO_LENGTH</a></code>, <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code>, <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf4ce538944f65ac97d82bfeaa9345c42"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_begin_recv </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the context for receiving. </p>
<p>This function should be called to initialize the context for receiving a message or to begin parsing a document. This function is called in the server and client-side code generated by soapcpp2, and in the generated <code>soap_T_read</code> functions to deserialize data of type <code>T</code>. For example, it is called by <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> (via <code><a class="el" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb" title="Initiates serving a pending client request. ">soap_begin_serve</a></code>) at the server side when a client request is pending. This function parses HTTP, DIME, MIME and SOAP headers if present and updates the context with the engine state. Therefore, this function should not be called more than once to initialize the context for receiving. The source of the data read is <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code>, <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>, <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code>, <code><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f" title="Finalize the context after receiving. ">soap_end_recv</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9c251be717c7c4044dac7a79ecd6163a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_begin_send </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the context for sending. </p>
<p>This function should be called to initialize the context for sending a message or to write a document. This function is called in the server and client-side code generated by soapcpp2, and in the generated <code>soap_T_write</code> functions to serialize data of type <code>T</code>. For example, it is called by <code><a class="el" href="group__group__io.html#ga5c87e9d0a43fe18cc349c724f198f64a" title="Connect to a server using HTTP POST. ">soap_connect</a></code> (via <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>) at the client side when a client connects to a server to send the HTTP headers and message body. The destination of the data to be send is <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code> when nonzero or <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code> when non-NULL. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code>, <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code>, <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code>, <code><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9" title="Finalize the context after sending. ">soap_end_send</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga5652f1b77271d434d0a4b66d5a607adb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_begin_serve </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initiates serving a pending client request. </p>
<p>This function processes the HTTP headers and XML SOAP headers if present of the pending request on <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> or on standard input/output <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code> and <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code>, e.g. for CGI and FastCGI services. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code>, <code><a class="el" href="group__group__io.html#ga4e138b90120efda4a1259d93d79bd2ad" title="Process a pending request. ">soap_serve_request</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0a9725a3edbc27b97456190fee47cc18"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__soap.html#ga6eb1bde7cecc2fbadbcbbc6395227439">SOAP_SOCKET</a> soap_bind </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>backlog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind and listen to a port. </p>
<p>This function binds to the specified port and starts listening for client requests. The <code>host</code> parameter when non-NULL is the name of the host on which this service runs. The <code>port</code> parameter is the port number to bind, which must not be in use by another service. The call may also fail if the port was recently in use by this service. Use <code>SO_REUSEADDR</code> with <code><a class="el" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59" title="User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by ...">soap::bind_flags</a></code> to immediately reuse the port, but use this option with caution to prevent "port stealing" attacks. The <code>backlog</code> parameter is used with <code>listen</code>, which defines the maximum length for the queue of pending connections. If a connection request arrives with the queue full, the client may receive an error with an indication of <code>ECONNREFUSED</code> or a connection reset. Alternatively, if the underlying protocol supports retransmission, the request may be ignored so that retries may succeed. Returns the <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code> socket bound to the port or the invalid socket handle <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> when an error occurred.</p>
<dl class="section note"><dt>Note</dt><dd>A small <code>backlog</code> value should be used with iterative (i.e. non-multi-threaded) servers to improve fairness among connecting clients, recommended is a <code>backlog</code> value between 2 and 10. A smaller value increases fairness and defends against denial of service, but hampers performance because connection requests may be refused when the queue is full. Also short <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code> and <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code> values of a few seconds at the most should be used to prevent clients from using connections for long by terminating unacceptably slow message exchanges that exceed the timeout thresholds. In the worst case, a connecting client may have to wait <code>backlog</code> * (<code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code> + <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>) seconds to have the connection accepted by an iterative server when the backlog queue is full, or even longer when message sizes are very large, e.g. several MBs, requiring multiple message data packet exchanges. Larger <code>backlog</code> values can be safely used with multi-threaded servers, such as 50 to 128, where 128 is a typical maximum on most operating systems. The actual value does not matter when connections are accepted as soon as they arrive by <code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code> and then handled by threads executing <code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code> (for HTTPS) and <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code>.</dd></dl>
<p>This function effectively deployes a stand-alone server on the specified port. There are three other alternatives for deploying services:</p><ul>
<li>CGI and FastCGI, see <code><a class="el" href="group__group__with.html#gac697013bbde81d22d15d83d122f85f18" title="When this macro is defined at compile time (undefined by default), enables and configures the engine ...">WITH_FASTCGI</a></code>.</li>
<li>IIS web server, see the <a href="../../isapi/html/index.html">ISAPI extension</a> for gSOAP.</li>
<li>Apache web server, see the <a href="../../apache/html/index.html">Apache module</a> for gSOAP.</li>
</ul>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59">bind_flags</a> = SO_REUSEADDR;            <span class="comment">// immediate port reuse</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap))</div><div class="line">          <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/threads.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59">bind_flags</a> = SO_REUSEADDR;            <span class="comment">// immediate port reuse</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__threads.html#ga53ca774b0fc84afe282a5419d2d7239a">THREAD_TYPE</a> tid;</div><div class="line">        <span class="keyword">struct </span>soap *tsoap = <a class="code" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a">soap_copy</a>(soap);</div><div class="line">        <span class="keywordflow">if</span> (!tsoap)</div><div class="line">          <a class="code" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a>(soap);</div><div class="line">        <span class="keywordflow">else</span></div><div class="line">          <span class="keywordflow">while</span> (<a class="code" href="group__group__threads.html#gabee88cce937a2709b4799ed8df36d486">THREAD_CREATE</a>(&amp;tid, (<span class="keywordtype">void</span>*(*)(<span class="keywordtype">void</span>*))&amp;process_request, (<span class="keywordtype">void</span>*)tsoap))</div><div class="line">            sleep(1); <span class="comment">// failed, try again</span></div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *process_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__threads.html#ga5848fc7adb50b3a15e40955dce7f8f53">THREAD_DETACH</a>(<a class="code" href="group__group__threads.html#ga9ab5a77b8cf2b98f7d6c1b48bb421f69">THREAD_ID</a>);</div><div class="line">  <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__with.html#ga40cbd680e7dbdeb63bce1d6d4b7b9620" title="When this macro is defined at compile time (undefined by default), IPv6 support is enabled and both I...">WITH_IPV6</a></code>, <code><a class="el" href="group__group__with.html#ga2854fe8474c2f87a9916d892306cb94c" title="When this macro is defined at compile time (undefined by default), IPv6-only is enabled for port bind...">WITH_IPV6_V6ONLY</a></code>, <code><a class="el" href="group__group__flags.html#ga388dae9abc80cd6f6d0ecfba383da03b" title="soap_mode IO input/output flag value to use UDP datagrams, message size is limited to UDP packet size...">SOAP_IO_UDP</a></code>, <code><a class="el" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59" title="User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by ...">soap::bind_flags</a></code>, <code><a class="el" href="structsoap.html#a08f1b076f0f041cdf89b9a969520fd4a" title="User-definable flag, when nonzero uses AF_INET6 instead of PF_UNSPEC when binding the soap::master so...">soap::bind_inet6</a></code>, <code><a class="el" href="structsoap.html#a90e04027ea9efa26e550f5438ab9f3d6" title="User-definable flag, when nonzero enables IPPROTO_IPV6 setsockopt IPV6_V6ONLY when binding the soap::...">soap::bind_v6only</a></code>, <code><a class="el" href="structsoap.html#af2b1fc40a14f7ed925658246a26497c8" title="User-definable value to set SO_RCVBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::rcvbuf</a></code>, <code><a class="el" href="structsoap.html#a02a7fffd05ff6e6c751f2033ef83854f" title="User-definable value to set SO_SNDBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::sndbuf</a></code>, <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code>, <code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code>, <code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code> socket value or <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> when an error occurred (check the return value with <code><a class="el" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c" title="Function macro to check if a socket is valid, i.e. not equal to SOAP_INVALID_SOCKET ...">soap_valid_socket</a></code>) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">host</td><td>name of the host or NULL </td></tr>
    <tr><td class="paramname">port</td><td>port number to bind </td></tr>
    <tr><td class="paramname">backlog</td><td>maximum queue length of pending requests </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf03f8d432c7849b8f52625cb1d483bc4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_body_begin_in </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the XML <em><code>&lt;SOAP-ENV:Body&gt;</code></em> element opening tag if present. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga4a2c3dd294f013a36b98d1ac02321493"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_body_begin_out </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Emit the XML <em><code>&lt;SOAP-ENV:Body&gt;</code></em> element opening tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa3fa118f5b72a71252aa5b0871fc188a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_body_end_in </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the XML <em><code>&lt;/SOAP-ENV:Body&gt;</code></em> element closing tag if present. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga8efb262aa6c3df326565b29a842cf452"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_body_end_out </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Emit the XML <em><code>&lt;/SOAP-ENV:Body&gt;</code></em> element closing tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga139afbf916c84724fef3f82aca4857d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void soap_close_connection </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close the connection of the specified context using a self-pipe. </p>
<p>This function closes the connection of the specified context, i.e. when it hangs on socket IO and the specified <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code> and <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code> timeouts are not sufficient to release the blocking socket IO. This function force-closes a connection, which is typically done by another thread that detects a termination condition. Requires compilation with <code><a class="el" href="group__group__with.html#ga0f1f2dd7a7d88f5acdaaab010d8e99ff" title="When this macro is defined at compile time (undefined by default), the engine is configured to enable...">WITH_SELF_PIPE</a></code> and requires <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code> set to a nonzero timeout value.</p>
<p>Alternatively, <code><a class="el" href="group__group__threads.html#gab0733064c17124af0377d69e91d24430" title="Cancel a thread. ">THREAD_CANCEL</a></code> can be used with a thread cleanup function added with <code>pthread_cleanup_push</code>. See <code><a class="el" href="group__group__threads.html#gab0733064c17124af0377d69e91d24430" title="Cancel a thread. ">THREAD_CANCEL</a></code> for details.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/threads.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59">bind_flags</a> = SO_REUSEADDR;            <span class="comment">// immediate port reuse</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">{</div><div class="line">  <span class="keywordflow">while</span> (1)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">    {</div><div class="line">      <a class="code" href="group__group__threads.html#ga53ca774b0fc84afe282a5419d2d7239a">THREAD_TYPE</a> tid;</div><div class="line">      <span class="keyword">struct </span>soap *tsoap = <a class="code" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a">soap_copy</a>(soap);</div><div class="line">      <span class="keywordflow">if</span> (!tsoap)</div><div class="line">        <a class="code" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a>(soap);</div><div class="line">      <span class="keywordflow">else</span></div><div class="line">        <span class="keywordflow">while</span> (<a class="code" href="group__group__threads.html#gabee88cce937a2709b4799ed8df36d486">THREAD_CREATE</a>(&amp;tid, (<span class="keywordtype">void</span>*(*)(<span class="keywordtype">void</span>*))&amp;accept_request, (<span class="keywordtype">void</span>*)tsoap))</div><div class="line">          sleep(1); <span class="comment">// failed, try again</span></div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">    {</div><div class="line">      <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      sleep(1);</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">    {</div><div class="line">      <span class="keywordflow">break</span>;</div><div class="line">    }</div><div class="line">    <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">    <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  }</div><div class="line">}</div><div class="line"><a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *accept_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__threads.html#ga53ca774b0fc84afe282a5419d2d7239a">THREAD_TYPE</a> tid;</div><div class="line">  <span class="keyword">struct </span>soap *tsoap;</div><div class="line">  <a class="code" href="group__group__threads.html#ga5848fc7adb50b3a15e40955dce7f8f53">THREAD_DETACH</a>(<a class="code" href="group__group__threads.html#ga9ab5a77b8cf2b98f7d6c1b48bb421f69">THREAD_ID</a>);</div><div class="line">  <span class="comment">// create a new thread that is timed to execute for max 10 seconds</span></div><div class="line">  tsoap = <a class="code" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a">soap_copy</a>(soap);</div><div class="line">  <span class="keywordflow">if</span> (!tsoap)</div><div class="line">  {</div><div class="line">    <a class="code" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94">soap_force_closesock</a>(soap);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">else</span></div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group__group__threads.html#gabee88cce937a2709b4799ed8df36d486">THREAD_CREATE</a>(&amp;tid, (<span class="keywordtype">void</span>*(*)(<span class="keywordtype">void</span>*))&amp;process_request, (<span class="keywordtype">void</span>*)tsoap))</div><div class="line">      sleep(1); <span class="comment">// failed, try again</span></div><div class="line">    <span class="comment">// allow serving the request by the new thread for up to 30 seconds max</span></div><div class="line">    sleep(30);</div><div class="line">    <span class="comment">// terminate soap_serve in process_request then wait for it to join</span></div><div class="line">    <a class="code" href="group__group__io.html#ga139afbf916c84724fef3f82aca4857d3">soap_close_connection</a>(tsoap);</div><div class="line">    <a class="code" href="group__group__threads.html#ga6bad18c2ce46fa43f1f4d83c8010a43b">THREAD_JOIN</a>(tid);</div><div class="line">    <span class="comment">// clean up the terminated thread context</span></div><div class="line">    <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(tsoap);</div><div class="line">  }</div><div class="line">  <span class="comment">// clean up</span></div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> *process_request(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> NULL;</div><div class="line">}</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Requires gSOAP 2.8.71 or greater, compilation with <code><a class="el" href="group__group__with.html#ga0f1f2dd7a7d88f5acdaaab010d8e99ff" title="When this macro is defined at compile time (undefined by default), the engine is configured to enable...">WITH_SELF_PIPE</a></code>, and nonzero <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code> and <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code> timeout values.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c" title="Close the socket connection. ">soap_closesock</a></code>, <code><a class="el" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94" title="Forcibly close the socket connection. ">soap_force_closesock</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga06d59094afa3df6b1b9f6b2bb484207c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_closesock </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close the socket connection. </p>
<p>This function should be called to close <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code>. The socket is closed and <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> is set to <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> if the socket is valid, keep-alive is not enabled and not currently active, i.e. the socket is closed when <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> != <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code> and <code><a class="el" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83" title="HTTP keep-alive flag (try to enable when -1, disabled when 0) and counter (enabled when &gt;0) ...">soap::keep_alive</a></code> == 0. Therefore, this function keeps the socket connection open when keep-alive is currently active. This function may be called multiple times but closes the socket just once if the socket connection was open. This function is called in the server and client-side code generated by soapcpp2. Returns the current value of <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> to propagate the error state when used as <code>return soap_closesock(soap);</code>.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94" title="Forcibly close the socket connection. ">soap_force_closesock</a></code>, <code><a class="el" href="group__group__io.html#ga139afbf916c84724fef3f82aca4857d3" title="Close the connection of the specified context using a self-pipe. ">soap_close_connection</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the value of <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> (<code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga5c87e9d0a43fe18cc349c724f198f64a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_connect </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to a server using HTTP POST. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP POST and the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). Upon successful completion, messages can be sent to and/or received from the server.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga5c87e9d0a43fe18cc349c724f198f64a">soap_connect</a>(soap, <a class="code" href="structsoap.html#aed1b86b8a34aea86103751a932c9dce9">endpoint</a>, NULL)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga315b6e1d5888780bf4ef320c50f23796"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_connect_command </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e">soap_http_command</a>&#160;</td>
          <td class="paramname"><em>http_command</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to a server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using the HTTP method specified by the <code>http_command</code> with a <code><a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e" title="HTTP command methods for soap_connect_command ">soap_http_command</a></code> value and using the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). Before calling <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code> with <code><a class="el" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f" title="HTTP POST command code. ">SOAP_POST</a></code>, <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code>, <code><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701" title="HTTP PATCH command code with custom content type. ">SOAP_PATCH</a></code> or <code><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335" title="HTTP PUT command code with custom content type. ">SOAP_PUT</a></code>, either the HTTP content length <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> must be determined with <code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code> and <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, or the mode of the context should be set to <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code>. ALso for HTTP methods <code><a class="el" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f" title="HTTP POST command code. ">SOAP_POST</a></code>, <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code>, <code><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701" title="HTTP PATCH command code with custom content type. ">SOAP_PATCH</a></code> and <code><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335" title="HTTP PUT command code with custom content type. ">SOAP_PUT</a></code> the <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string should be set before calling <code><a class="el" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796" title="Connect to a server. ">soap_connect_command</a></code>. Upon successful completion of this function, messages can be sent to and/or received from the server. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line">soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line"><span class="comment">// HTTP POST request with chunked transfer</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47">SOAP_POST_FILE</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *request = <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>;</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line">soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line"><span class="comment">// HTTP POST request, here we compute the content length instead of chunked transfer with SOAP_IO_CHUNK or storing the entire message with SOAP_IO_STORE</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba">soap_begin_count</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4">soap_end_count</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga315b6e1d5888780bf4ef320c50f23796">soap_connect_command</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <a class="code" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47">SOAP_POST_FILE</a>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, request)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga3abcdd760843c4bdc56c19b85453ed04" title="HTTP GET command code. ">SOAP_GET</a></code>, <code><a class="el" href="group__group__io.html#ga41f39e73106f1a2283ae3aa65698050f" title="HTTP POST command code. ">SOAP_POST</a></code>, <code><a class="el" href="group__group__io.html#ga4c291263eadcefa290e90c64e632ae47" title="HTTP POST command code with custom content type. ">SOAP_POST_FILE</a></code>, <code><a class="el" href="group__group__io.html#ga0f6661cfe8eff845600e7a75a2f46701" title="HTTP PATCH command code with custom content type. ">SOAP_PATCH</a></code>, <code><a class="el" href="group__group__io.html#ga32a114ef8df190363b9c3ad37bcb6335" title="HTTP PUT command code with custom content type. ">SOAP_PUT</a></code>, <code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code>, <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">http_command</td><td><code><a class="el" href="group__group__io.html#ga3b89c45fdd4914818fde0fd30013335e" title="HTTP command methods for soap_connect_command ">soap_http_command</a></code> with HTTP method code </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga98e63f6969d2d83a31f178728a01c7cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_DELETE </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP DELETE content from server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP DELETE. No messages are sent and received. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc">soap_DELETE</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/DELETE&quot;</span>))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div></div><!-- fragment --><p>To implement server-side HTTP DELETE handling use <code><a class="el" href="group__group__callbacks.html#gaf2bda0187489c8f2b9857f61b96ad0e0" title="Callback to implement logic at the server-side to serve responses to HTTP DELETE requests from client...">soap::fdel</a></code>.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>, <code><a class="el" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd" title="User-definable maximum message length that is permitted to be received, zero means unlimited (the val...">soap::recv_maxlength</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code>, <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae2099fe49c19fb1409c31ec3d51fd8b4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_end_count </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finalize context to count message length for sending. </p>
<p>This function is used to determine the HTTP content length. This is done by sending the message after calling this function to update <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code>. HTTP requires either the HTTP content length header or HTTP transfer encoding chunked with <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code>. Alternatively, the mode of the context can be set to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to buffer the entire message in memory to determine the message content length.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code>, <code><a class="el" href="group__group__flags.html#gae27399f26b6a31d91b6884b957925c3e" title="soap_mode IO output flag value to calculate message length when sending a message without transmissio...">SOAP_IO_LENGTH</a></code>, <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code>, <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga86b0c04e8baa911fc57e7f1220f9eb8f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_end_recv </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finalize the context after receiving. </p>
<p>This function should be called to finalize the context after receiving a message or to end parsing a document. This function is called in the server and client-side code generated by soapcpp2, and in the generated <code>soap_T_read</code> functions to deserialize data of type <code>T</code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga290ddb46afdbf5ec6669b6ac8daca5c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_end_send </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finalize the context after sending. </p>
<p>This function should be called to finalize the context after sending a message or to end writing a document. This function is called in the server and client-side code generated by soapcpp2, and in the generated <code>soap_T_write</code> functions to serialize data of type <code>T</code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga9c251be717c7c4044dac7a79ecd6163a" title="Initialize the context for sending. ">soap_begin_send</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gacb1779f009132aca606ad0fe33b41c04"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_envelope_begin_in </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the XML <em><code>&lt;SOAP-ENV:Envelope&gt;</code></em> element opening tag if present. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaace2f3addda6f24c025289d76c12c119"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_envelope_begin_out </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Emit the XML <em><code>&lt;SOAP-ENV:Envelope&gt;</code></em> element opening tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga5a5df8f27327c7dc923264bac5bf1c16"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_envelope_end_in </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the XML <em><code>&lt;/SOAP-ENV:Envelope&gt;</code></em> element closing tag if present. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3986d0f18df7c034b214e2b745545a97"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_envelope_end_out </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Emit the XML <em><code>&lt;/SOAP-ENV:Envelope&gt;</code></em> element closing tag if <code><a class="el" href="structsoap.html#a39daa19f039aebc76b8c4b6bf933570a" title="SOAP version (0 = no SOAP, 1 = SOAP 1.1, 2 = SOAP 1.2) ">soap::version</a></code> is nonzero. </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0ca0c64dc76af8617956a62cf117db94"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_force_closesock </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Forcibly close the socket connection. </p>
<p>This function immediately closes <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> and should only be used when <code><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c" title="Close the socket connection. ">soap_closesock</a></code> does not suffice. By contrast, <code><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c" title="Close the socket connection. ">soap_closesock</a></code> gently finalizes the SSL connection, and when <code><a class="el" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83" title="HTTP keep-alive flag (try to enable when -1, disabled when 0) and counter (enabled when &gt;0) ...">soap::keep_alive</a></code> == 0 calls <code>shutdown</code> and <code>close</code> on <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code>. By calling <code><a class="el" href="group__group__io.html#ga0ca0c64dc76af8617956a62cf117db94" title="Forcibly close the socket connection. ">soap_force_closesock</a></code> the socket is forcibly closed immediately and <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> is set to <code><a class="el" href="group__group__soap.html#gab9e77b1557780293eec0b269ef191472" title="Macro that defines a portable invalid socket value (usually -1, but the value depends on the OS) ...">SOAP_INVALID_SOCKET</a></code>, even when keep-alive is currently active. This function may be called multiple times but closes the socket just once if the socket connection was open. Returns the current value of <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> to propagate the error state when used as <code>return soap_force_closesock(soap);</code>.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c" title="Close the socket connection. ">soap_closesock</a></code>, <code><a class="el" href="group__group__io.html#ga139afbf916c84724fef3f82aca4857d3" title="Close the connection of the specified context using a self-pipe. ">soap_close_connection</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the value of <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> (<code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga953bdee7ebf242b056834e5592079ae9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_GET </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP GET content from server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP GET and the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). This call should be followed by <code><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9" title="Finalize the context after sending. ">soap_end_send</a></code> to send an empty HTTP body. Upon successful completion, messages can be received from the server. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<p>This function is used by the soapcpp2-generated <code>soap_GET_T</code> functions for types <code>T</code> to HTTP GET the XML deserialized value of type <code>T</code> from a server.</p>
<p>To implement server-side HTTP GET handling use <code><a class="el" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16" title="Callback to implement logic at the server-side to serve responses to HTTP GET requests from clients...">soap::fget</a></code>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9">soap_GET</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/GET&quot;</span>, NULL)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>, <code><a class="el" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd" title="User-definable maximum message length that is permitted to be received, zero means unlimited (the val...">soap::recv_maxlength</a></code>, <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code>, <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac5cd5455317210135c78a04c45ed8f55"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a> soap_get0 </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get next byte without consuming it. </p>
<p>This function returns the next byte on the input without consuming it, i.e. peeks one byte ahead. Reads a byte from <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or from <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or from <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>. Returns the next byte or EOF when an error occurred and sets <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> to a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> value and <code><a class="el" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13" title="The errno value of the last failed IO operation. ">soap::errnum</a></code> to the <code>errno</code> value of the failure.</p><dl class="section return"><dt>Returns</dt><dd>byte read or EOF when an error occurred </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf9fb9f0468ed93132119bcf600b3b0a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__io.html#ga0c7ca927c25cf2e5f03d0add91b3eb6d">soap_wchar</a> soap_get1 </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get next byte. </p>
<p>This function returns the next byte on the input. Reads a byte from <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or from <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or from <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>. Returns the next byte or EOF when an error occurred and sets <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> to a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> value and <code><a class="el" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13" title="The errno value of the last failed IO operation. ">soap::errnum</a></code> to the <code>errno</code> value of the failure.</p><dl class="section return"><dt>Returns</dt><dd>byte read or EOF when an error occurred </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3f54c5916c6f6ddffec5d7120a230f46"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_getline </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a header line. </p>
<p>This function stores a header line into the specified buffer <code>buf</code> of maxiumum length <code>len</code>. This function should be used to read HTTP and MIME headers, which end with CRLF or LF. The function handles header continuations (indents). This function reads input from <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or from <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or from <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p><dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">buf</td><td>buffer to fill (string) </td></tr>
    <tr><td class="paramname">len</td><td>maximum size of the buffer (int) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae2cd37f875d3314eec314b8723e2ffd8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* soap_http_get_body </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the HTTP body message as a string. </p>
<p>This function parses an HTTP body message into a string, whether or not an HTTP body message is present. This function should be called immediately after calling <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>. Note that <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code> is called at the server side before a HTTP callback is called, such as <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code> and <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>. Callbacks and the <code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code> HTTP POST plugin handlers should therefore not call <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>. Also, <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code> is called at the client side by HTTP functions such as <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, after which the HTTP body can then be then be checked with <code><a class="el" href="group__group__io.html#ga9a6ffc8733e72dfa63ece22ac9c077d3" title="Check if HTTP body message is not empty. ">soap_http_has_body</a></code> and retrieved with <code><a class="el" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8" title="Get the HTTP body message as a string. ">soap_http_get_body</a></code>. This function reads input from from <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or from <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>, and sets the <code>len</code> pointer parameter to the length of the string read if <code>len</code> is not NULL. After calling this function, <code><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f" title="Finalize the context after receiving. ">soap_end_recv</a></code> should be called. Returns the HTTP body as a string allocated in managed memory or returns "" (empty string, since version 2.8.71 or returns NULL for previous versions) when no HTTP message body is present or NULL when an error occurred and sets <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code>.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK or SOAP_IO_STORE</span></div><div class="line">  <span class="keywordtype">char</span> *response = NULL;</div><div class="line">  <span class="keywordtype">size_t</span> response_len;</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9">soap_GET</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/GET&quot;</span>, NULL)</div><div class="line">   || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line">   || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line">   || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">    <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">  <span class="keywordflow">else</span></div><div class="line">    fwrite(response, 1, response_len, stdout);</div><div class="line">  <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854">fput</a> = my_put; <span class="comment">// HTTP PUT handler to serve HTTP PUT</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_put(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordtype">size_t</span> len;</div><div class="line">  <span class="keywordtype">char</span> *message = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;len);</div><div class="line">  <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap);</div><div class="line">  ... <span class="comment">// use the message data</span></div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a>(soap, 202); <span class="comment">// HTTP 202 Accepted</span></div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__group__callbacks.html">Callback functions</a>, <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>, <code><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f" title="Finalize the context after receiving. ">soap_end_recv</a></code>, <code><a class="el" href="group__group__io.html#ga9a6ffc8733e72dfa63ece22ac9c077d3" title="Check if HTTP body message is not empty. ">soap_http_has_body</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>, <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>, <code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>HTTP body as a string or NULL when an error occurred </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">len</td><td>pointer to the length variable to assign or NULL </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga2fffac56a74407e77762dd2ff9c761fa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* soap_http_get_form </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the HTTP POST application/x-www-form-urlencoded data as a string. </p>
<p>This function parses an HTTP body with application/x-www-form-urlencoded data into a string, prepends a <code>?</code>, and returns this string allocated in managed memory or NULL when an error occurred and sets <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code>.</p>
<dl class="section note"><dt>Note</dt><dd>This function is declared and defined in <em><code>gsoap/plugin/httpform.h</code></em> and <em><code>gsoap/plugin/httpform.c</code></em> and requires the <code><a class="el" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c" title="The HTTP POST form plugin registration function. ">http_form</a></code> plugin.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga85c7fe6ae796534e2f54678c014c507c" title="The HTTP POST form plugin registration function. ">http_form</a></code>. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gafee768c3e45ee451c4cd6907e446c888"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void soap_http_get_stats </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>stat_get</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>stat_post</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>stat_fail</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t **&#160;</td>
          <td class="paramname"><em>hist_min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t **&#160;</td>
          <td class="paramname"><em>hist_hour</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t **&#160;</td>
          <td class="paramname"><em>hist_day</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Collect access statistics with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin. </p>
<p>This function sets the specified minutes, hour, and day parameters to point to an array of requests per minute, an array of request per hour, and an array of requests per day of the year. The minutes array has 60 entries, the hour array has 24 entries, and the day array has 365 entries (a leap year will roll over). The plugin will collect the stats among a set of server threads if the spawned thread contexts are created with <code><a class="el" href="group__group__context.html#gab4c3f8ce80baf0f1fec8c86f0bb5788a" title="Allocate and initialize a new soap context as a copy of the given soap context. ">soap_copy</a></code>.</p>
<dl class="section note"><dt>Note</dt><dd>This function is declared and defined in <em><code>gsoap/plugin/httpget.h</code></em> and <em><code>gsoap/plugin/httpget.c</code></em> and requires the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.</dd></dl>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httpget.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <a class="code" href="group__group__plugin.html#ga800a005ce0f0236461d1a5dbf4be2a80">soap_register_plugin_arg</a>(soap, <a class="code" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba">http_get</a>, http_get_handler);</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordtype">size_t</span> stat_get, stat_post, stat_fail, *hist_min, *hist_hour, *hist_day;</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap))</div><div class="line">          <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__io.html#gafee768c3e45ee451c4cd6907e446c888">soap_http_get_stats</a>(soap, &amp;stat_get, &amp;stat_post, &amp;stat_fail, &amp;hist_min, &amp;hist_hour, &amp;hist_day);</div><div class="line">      <span class="comment">// show the number of GET, POST, and failures</span></div><div class="line">      printf(<span class="stringliteral">&quot;\n#GET = %d #POST = %d failures = %d&quot;</span>, stat_get, stat_post, stat_fail);</div><div class="line">      <span class="comment">// show the stats collected per hour</span></div><div class="line">      printf(<span class="stringliteral">&quot;\nBy hour: &quot;</span>);</div><div class="line">      <span class="keywordflow">for</span> (i = 0; i &lt; 24; i++)</div><div class="line">        printf(<span class="stringliteral">&quot;%8d&quot;</span>, i);</div><div class="line">      printf(<span class="stringliteral">&quot;\nRequests:&quot;</span>);</div><div class="line">      <span class="keywordflow">for</span> (i = 0; i &lt; 24; i++)</div><div class="line">        printf(<span class="stringliteral">&quot;%8d&quot;</span>, hist_hour[i]);</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">stat_get</td><td>points to a variable to assign the number of GET requests </td></tr>
    <tr><td class="paramname">stat_post</td><td>points to a variable to assign the number of POST requests </td></tr>
    <tr><td class="paramname">stat_fail</td><td>points to a variable to assign the number of failed requests </td></tr>
    <tr><td class="paramname">hist_min</td><td>points to a pointer to an array of 60 entries with histogram of requests per minute </td></tr>
    <tr><td class="paramname">hist_hour</td><td>points to a pointer to an array of 24 entries with histogram of requests per hour </td></tr>
    <tr><td class="paramname">hist_day</td><td>points to a pointer to an array of 365 entries with histogram of requests per day </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9a6ffc8733e72dfa63ece22ac9c077d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_http_has_body </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if HTTP body message is not empty. </p>
<p>This function returns nonzero if an HTTP message body is present, zero otherwise. This function should be called immediately after calling <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>. Note that <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code> is called at the server side before a HTTP callback is called, such as <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code> and <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>. Callbacks and the <code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code> HTTP POST plugin handlers should therefore not call <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>. Also, <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code> is called at the client side by HTTP functions such as <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, after which the HTTP body can then be checked with <code><a class="el" href="group__group__io.html#ga9a6ffc8733e72dfa63ece22ac9c077d3" title="Check if HTTP body message is not empty. ">soap_http_has_body</a></code> and retrieved with <code><a class="el" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8" title="Get the HTTP body message as a string. ">soap_http_get_body</a></code>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__group__callbacks.html">Callback functions</a>, <code><a class="el" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42" title="Initialize the context for receiving. ">soap_begin_recv</a></code>, <code><a class="el" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f" title="Finalize the context after receiving. ">soap_end_recv</a></code>, <code><a class="el" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8" title="Get the HTTP body message as a string. ">soap_http_get_body</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>, <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>, <code><a class="el" href="group__group__io.html#ga4c08d5ef28bc0dc37eee4633acdd1140" title="The HTTP POST plugin registration function. ">http_post</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>nonzero if an HTTP body is present, zero otherwise </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga71eebf1ab266c7480831a2fb10b6ca1a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_PATCH </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP PATCH content to server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP PATCH and the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). The HTTP content type of the data sent to the server is specified by <code>type</code>. If the mode is not <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> then this function temporarily sets the mode of the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to compute the HTTP content length. Upon successful completion, messages can be sent to the server and an empty response should be received by calling <code><a class="el" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c" title="Receive an HTTP response message from the server that is assumed to be empty. ">soap_recv_empty_response</a></code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<p>If the <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is non-NULL, this string is used as the HTTP content type to be included in the HTTP header. Otherwise, the HTTP content header is <code>text/xml</code> by default. The <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is automatically reset to NULL after the HTTP POST call and has to be set again for the next call.</p>
<p>This function is used by the soapcpp2-generated <code>soap_PATCH_T</code> functions for types <code>T</code> to HTTP PATCH the XML serialized value of type <code>T</code> to a server.</p>
<p>To implement server-side HTTP PATCH handling use <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK (preferred) or SOAP_IO_STORE</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a">soap_PATCH</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/PATCH&quot;</span>, NULL, <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>, <code><a class="el" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd" title="User-definable maximum message length that is permitted to be received, zero means unlimited (the val...">soap::recv_maxlength</a></code>, <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
    <tr><td class="paramname">type</td><td>HTTP content type string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gab331e9628197f71adb4caabacd20315e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_poll </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Poll the connection. </p>
<p>This function returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> if the connection is ready to send and receive data, <code><a class="el" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd" title="A soap_status error code: unexpected end of file, no input, transmission interrupted or timed out (sa...">SOAP_EOF</a></code> otherwise. Also returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> if the socket connection is closed but data can still be read or written from/to other streams.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe" title="Check if the connection is ready to receive pending data. ">soap_ready</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> (ready), <code><a class="el" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd" title="A soap_status error code: unexpected end of file, no input, transmission interrupted or timed out (sa...">SOAP_EOF</a></code> (not ready), or <code><a class="el" href="group__group__errors.html#ga5087817634de39f79e74246b1eb4da54" title="A soap_status error code: a TCP/IP connection error occured. ">SOAP_TCP_ERROR</a></code> (error) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf502246613cb6d4ea120965065d8c0b2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_POST </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP POST content to server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP POST and the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). The HTTP content type of the data sent to the server is specified by <code>type</code>. If the mode is not <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> then this function temporarily sets the mode of the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to compute the HTTP content length. Upon successful completion, messages can be sent to and received from the server. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<p>If the <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is non-NULL, this string is used as the HTTP content type to be included in the HTTP header. Otherwise, the HTTP content header is <code>text/xml</code> by default. The <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is automatically reset to NULL after the HTTP POST call and has to be set again for the next call.</p>
<p>This function is used by the soapcpp2-generated <code>soap_POST_send_T</code> functions for types <code>T</code> to HTTP POST the XML serialized value of type <code>T</code> to a server. Use <code>soap_POST_recv_T</code> to receive a HTTP POST response deserialized into a value of (another) type <code>T</code>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK (preferred) or SOAP_IO_STORE</span></div><div class="line"><span class="keywordtype">char</span> *response = NULL;</div><div class="line"><span class="keywordtype">size_t</span> response_len;</div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2">soap_POST</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/POST&quot;</span>, NULL, <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#gaf4ce538944f65ac97d82bfeaa9345c42">soap_begin_recv</a>(soap)</div><div class="line"> || (response = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;response_len)) != NULL</div><div class="line"> || <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><span class="keywordflow">else</span></div><div class="line">  printf(<span class="stringliteral">&quot;%s&quot;</span>, response);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>, <code><a class="el" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd" title="User-definable maximum message length that is permitted to be received, zero means unlimited (the val...">soap::recv_maxlength</a></code>, <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709" title="HTTP PUT content to server. ">soap_PUT</a></code>, <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code>, <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
    <tr><td class="paramname">type</td><td>HTTP content type string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae93e23c11379e71baeb6fafe68e14709"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_PUT </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>action</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>HTTP PUT content to server. </p>
<p>This function connects to the server specified by the <code>endpoint</code> URL string, using HTTP PUT and the HTTP SOAP Action header specified by the <code>action</code> string (or NULL). The HTTP content type of the data sent to the server is specified by <code>type</code>. If the mode is not <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> (preferred) or <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> then this function temporarily sets the mode of the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to compute the HTTP content length. Upon successful completion, messages can be sent to the server and an empty response should be received by calling <code><a class="el" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c" title="Receive an HTTP response message from the server that is assumed to be empty. ">soap_recv_empty_response</a></code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<p>If the <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is non-NULL, this string is used as the HTTP content type to be included in the HTTP header. Otherwise, the HTTP content header is <code>text/xml</code> by default. The <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> string is automatically reset to NULL after the HTTP POST call and has to be set again for the next call.</p>
<p>This function is used by the soapcpp2-generated <code>soap_PUT_T</code> functions for types <code>T</code> to HTTP PUT the XML serialized value of type <code>T</code> to a server.</p>
<p>To implement server-side HTTP PUT handling use <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>.</p>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga51cde138234ed7ec8c4e25bdf6418658">soap_new1</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// use SOAP_IO_CHUNK (preferred) or SOAP_IO_STORE</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#gae93e23c11379e71baeb6fafe68e14709">soap_PUT</a>(soap, <span class="stringliteral">&quot;http://www.example.com/API/PUT&quot;</span>, NULL, <span class="stringliteral">&quot;text/xml; charset=utf-8&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line"> || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap)</div><div class="line"> || <a class="code" href="group__group__io.html#ga8bb9d541b641a6c261d8879363c7694c">soap_recv_empty_response</a>(soap))</div><div class="line">  <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line"><a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="structsoap.html#a52a22fafc369b3a54fb0d16f53158794" title="User-definable setsockopt level SOL_SOCKET flags when connecting soap::socket to a server (the value ...">soap::connect_flags</a></code>, <code><a class="el" href="structsoap.html#af32b5f3975eac2bd1202571515859163" title="User-definable timeout when waiting to connect to a server at the client-side, positive timeout value...">soap::connect_timeout</a></code>, <code><a class="el" href="structsoap.html#ac5d5fb92fffda724ccb3b038d2bb2388" title="User-definable timeout to receive a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::recv_timeout</a></code>, <code><a class="el" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474" title="User-definable timeout to send a packet of data, positive timeout values are seconds, negative timeout values are microseconds, zero means no timeout (the value is 0 by default) ">soap::send_timeout</a></code>, <code><a class="el" href="structsoap.html#afcf1d236d052579122f785d7639c43c7" title="User-definable timeout to send or receive an entire message, positive timeout values are seconds...">soap::transfer_timeout</a></code>, <code><a class="el" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd" title="User-definable maximum message length that is permitted to be received, zero means unlimited (the val...">soap::recv_maxlength</a></code>, <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code>, <code><a class="el" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9" title="HTTP GET content from server. ">soap_GET</a></code>, <code><a class="el" href="group__group__io.html#ga71eebf1ab266c7480831a2fb10b6ca1a" title="HTTP PATCH content to server. ">soap_PATCH</a></code>, <code><a class="el" href="group__group__io.html#gaf502246613cb6d4ea120965065d8c0b2" title="HTTP POST content to server. ">soap_POST</a></code>, <code><a class="el" href="group__group__io.html#ga98e63f6969d2d83a31f178728a01c7cc" title="HTTP DELETE content from server. ">soap_DELETE</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">endpoint</td><td>URL string </td></tr>
    <tr><td class="paramname">action</td><td>SOAP Action string or NULL </td></tr>
    <tr><td class="paramname">type</td><td>HTTP content type string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga07e242fefbde797cf9f76ff97f788334"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_putheader </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Emit the SOAP Header pointed to by <code><a class="el" href="structsoap.html#ac091dfe4e01b6a082d916c381e7006ba" title="The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...">soap::header</a></code> </p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga6a84b61777a04a066e6e11baa89c579b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* soap_query </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extract the query string from the URL path at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin. </p>
<p>At the server side the value <code><a class="el" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309" title="The client request path as received on the server side. ">soap::path</a></code> is set to the URL's path string which may include a query string of the form "?key=val&amp;key=val" with a sequence of key=val pairs, where the value is optional. Returns the query string or NULL when none is present. To extract the keys and values from the string returned by this function, use <code><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5" title="Extract the next query string key at the server side with the http_get plugin. ">soap_query_key</a></code> and <code><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86" title="Extract the next query string value at the server side with the http_get plugin. ">soap_query_val</a></code>.</p>
<p>The <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin sets a HTTP GET handler function to serve HTTP GET requests (or NULL to remove a handler) with <code>soap_register_plugin_arg(soap, http_get, http_get_handler)</code> and keeps track of the number of GET and POST invocations made and the number of server requests by the minute, by the hour, and by the day.</p>
<dl class="section note"><dt>Note</dt><dd>This function is declared and defined in <em><code>gsoap/plugin/httpget.h</code></em> and <em><code>gsoap/plugin/httpget.c</code></em> and requires the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.</dd></dl>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;plugin/httpget.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <a class="code" href="group__group__plugin.html#ga800a005ce0f0236461d1a5dbf4be2a80">soap_register_plugin_arg</a>(soap, <a class="code" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba">http_get</a>, http_get_handler);</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordtype">size_t</span> *min, *hour, *day;</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">      {</div><div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap))</div><div class="line">          <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">      {</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">        sleep(1);</div><div class="line">      }</div><div class="line">      <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">      {</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">      }</div><div class="line">      <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">      <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> http_get_handler(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordflow">if</span> (!strncmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/API/GET&quot;</span>, 8))</div><div class="line">  {</div><div class="line">    <span class="comment">// get the query key=val pairs from soap-&gt;path</span></div><div class="line">    <span class="keywordtype">char</span> *query = <a class="code" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a>(soap); </div><div class="line">    <span class="keywordflow">while</span> (query)</div><div class="line">    {</div><div class="line">      <span class="comment">// get next key=val pair</span></div><div class="line">      <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">      <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">      ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">    }</div><div class="line">    <span class="comment">// return a response message</span></div><div class="line">    soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="keywordflow">return</span> 404; <span class="comment">// HTTP 404 Not Found</span></div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> ns__webmethod(<span class="keyword">struct</span> soap *soap, ...)</div><div class="line">{</div><div class="line">  <span class="keywordtype">char</span> *query = <a class="code" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a>(soap); </div><div class="line">  <span class="keywordflow">while</span> (query)</div><div class="line">  {</div><div class="line">    <span class="comment">// get next key=val pair</span></div><div class="line">    <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">    <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">    ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">  }</div><div class="line">  ...</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5" title="Extract the next query string key at the server side with the http_get plugin. ">soap_query_key</a></code>, <code><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86" title="Extract the next query string value at the server side with the http_get plugin. ">soap_query_val</a></code>, <code><a class="el" href="group__group__io.html#gafee768c3e45ee451c4cd6907e446c888" title="Collect access statistics with the http_get plugin. ">soap_http_get_stats</a></code>. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae803685e32f840798dd5845eba176dc5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* soap_query_key </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extract the next query string key at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin. </p>
<p>This function takes a pointer to the string variable returned by <code><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b" title="Extract the query string from the URL path at the server side with the http_get plugin. ">soap_query</a></code> and updates it to point to the value (if present), then returns the query key or NULL if no more query key-value pairs are present in the query string.</p>
<dl class="section note"><dt>Note</dt><dd>This function is declared and defined in <em><code>gsoap/plugin/httpget.h</code></em> and <em><code>gsoap/plugin/httpget.c</code></em> and requires the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.</dd></dl>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="comment">// get the query key=val pairs from soap-&gt;path</span></div><div class="line"><span class="keywordtype">char</span> *query = <a class="code" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a>(soap); </div><div class="line"><span class="keywordflow">while</span> (query)</div><div class="line">{</div><div class="line">  <span class="comment">// get next key=val pair</span></div><div class="line">  <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">  <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">  ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b" title="Extract the query string from the URL path at the server side with the http_get plugin. ">soap_query</a></code>, <code><a class="el" href="group__group__io.html#gaba1919e769e74b32ea8726e012cbdb86" title="Extract the next query string value at the server side with the http_get plugin. ">soap_query_val</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>query string key </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">query</td><td>points to the string returned by soap_query and soap_query_val </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaba1919e769e74b32ea8726e012cbdb86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* soap_query_val </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extract the next query string value at the server side with the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin. </p>
<p>This function takes a pointer to the string variable returned by <code><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b" title="Extract the query string from the URL path at the server side with the http_get plugin. ">soap_query</a></code> and updates it to point to the next key (if present), then returns the query value or NULL if no value is bound to the key.</p>
<dl class="section note"><dt>Note</dt><dd>This function is declared and defined in <em><code>gsoap/plugin/httpget.h</code></em> and <em><code>gsoap/plugin/httpget.c</code></em> and requires the <code><a class="el" href="group__group__io.html#ga0ecdc43a53e494edc4f84e8c135659ba" title="The HTTP GET plugin registration function. ">http_get</a></code> plugin.</dd></dl>
<dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="comment">// get the query key=val pairs from soap-&gt;path</span></div><div class="line"><span class="keywordtype">char</span> *query = <a class="code" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b">soap_query</a>(soap); </div><div class="line"><span class="keywordflow">while</span> (query)</div><div class="line">{</div><div class="line">  <span class="comment">// get next key=val pair</span></div><div class="line">  <span class="keywordtype">char</span> *key = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">  <span class="keywordtype">char</span> *val = <a class="code" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5">soap_query_key</a>(soap, &amp;query);</div><div class="line">  ... <span class="comment">// use key and val (key is non-NULL, val may be NULL)</span></div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga6a84b61777a04a066e6e11baa89c579b" title="Extract the query string from the URL path at the server side with the http_get plugin. ">soap_query</a></code>, <code><a class="el" href="group__group__io.html#gae803685e32f840798dd5845eba176dc5" title="Extract the next query string key at the server side with the http_get plugin. ">soap_query_key</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>query string value or NULL </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">query</td><td>points to the string returned by soap_query and soap_query_key </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga115be6d4b62bd840bd7750fde1bb73fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_ready </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if the connection is ready to receive pending data. </p>
<p>This function returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> if the connection is ready to receive pending data, <code><a class="el" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd" title="A soap_status error code: unexpected end of file, no input, transmission interrupted or timed out (sa...">SOAP_EOF</a></code> otherwise. Also returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> if the socket connection is closed but data can still be read from other streams.</p>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="comment">// file.h interface header file for soapcpp2</span></div><div class="line"></div><div class="line"><span class="comment">// REST request data</span></div><div class="line"><span class="keyword">struct </span>ns__request</div><div class="line">{</div><div class="line">  <span class="keywordtype">int</span> SKU;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// REST response data</span></div><div class="line"><span class="keyword">struct </span>ns__response</div><div class="line">{</div><div class="line">  <span class="keywordtype">char</span> *product_name;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// SOAP web method response data</span></div><div class="line"><span class="keyword">struct </span>ns__webmethodResponse</div><div class="line">{</div><div class="line">  <span class="keywordtype">char</span> *string;</div><div class="line">  <span class="keywordtype">int</span> number;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">// SOAP web method</span></div><div class="line"><span class="keywordtype">int</span> ns__webmethod(<span class="keywordtype">char</span> *<span class="keywordtype">string</span>, <span class="keywordtype">int</span> number, <span class="keyword">struct</span> ns__webmethodResponse *response);</div></div><!-- fragment --> <pre class="fragment">soapcpp2 -c file.h
</pre><div class="fragment"><div class="line"><span class="comment">// SOAP client application (requires 2.8.75 or greater)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;ns.nsmap&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <span class="keyword">struct </span>ns__webmethodResponse response;</div><div class="line">  <span class="comment">// send the SOAP request message of ns__webmethod declared in a .h file for soapcpp2</span></div><div class="line">  <span class="keywordflow">if</span> (soap_send_ns__webmethod(soap, endpoint, NULL, <span class="stringliteral">&quot;hello&quot;</span>, 123))</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// wait on message ready to receive from server</span></div><div class="line">  <span class="keywordflow">while</span> (<a class="code" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe">soap_ready</a>(soap) == <a class="code" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd">SOAP_EOF</a>)</div><div class="line">  {</div><div class="line">    <span class="comment">// do some more work here (or sleep 1ms as below)</span></div><div class="line">    usleep(1000);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a>)</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// receive the SOAP response message of ns__webmethod declared in a .h file for soapcpp2</span></div><div class="line">  <span class="keywordflow">if</span> (soap_recv_ns__webmethod(soap, &amp;response))</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  ... <span class="comment">// process the response</span></div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">// REST POST client application</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;ns.nsmap&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <span class="keyword">struct </span>ns__request request;     <span class="comment">// serializable type declared in a .h file for soapcpp2</span></div><div class="line">  <span class="keyword">struct </span>ns__response response;   <span class="comment">// serializable type declared in a .h file for soapcpp2</span></div><div class="line">  soap_default_ns__request(soap, &amp;request);</div><div class="line">  ... <span class="comment">// populate request data</span></div><div class="line">  <span class="comment">// POST the REST request message using the ns__request serializer</span></div><div class="line">  <span class="keywordflow">if</span> (soap_POST_send_ns__request(soap, endpoint, &amp;request))</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// wait on message ready to receive from server</span></div><div class="line">  <span class="keywordflow">while</span> (<a class="code" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe">soap_ready</a>(soap) == <a class="code" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd">SOAP_EOF</a>)</div><div class="line">  {</div><div class="line">    <span class="comment">// do some more work here (or sleep 1ms as below)</span></div><div class="line">    usleep(1000);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a>)</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// receive the REST response message using the ns__response serializer</span></div><div class="line">  <span class="keywordflow">if</span> (soap_POST_recv_ns__response(soap, &amp;response))</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  ... <span class="comment">// process the response data</span></div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="comment">// REST GET client application</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;ns.nsmap&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  <span class="keyword">struct </span>ns__response response;   <span class="comment">// serializable type declared in a .h file for soapcpp2</span></div><div class="line">  <span class="comment">// HTTP GET</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga953bdee7ebf242b056834e5592079ae9">soap_GET</a>(soap, <span class="stringliteral">&quot;http://www.exanple.org/get?SKU=123&quot;</span>, NULL))</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// wait on message ready to receive from server</span></div><div class="line">  <span class="keywordflow">while</span> (<a class="code" href="group__group__io.html#ga115be6d4b62bd840bd7750fde1bb73fe">soap_ready</a>(soap) == <a class="code" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd">SOAP_EOF</a>)</div><div class="line">  {</div><div class="line">    <span class="comment">// do some more work here (or sleep 1ms as below)</span></div><div class="line">    usleep(1000);</div><div class="line">  }</div><div class="line">  <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a>)</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  <span class="comment">// receive the response message using the ns__response serializer</span></div><div class="line">  <span class="keywordflow">if</span> (soap_read_ns__response(soap, &amp;response))</div><div class="line">  {</div><div class="line">    <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    ... <span class="comment">// error</span></div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  ... <span class="comment">// process the response data</span></div><div class="line">  <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  <a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#gab331e9628197f71adb4caabacd20315e" title="Poll the connection. ">soap_poll</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> (ready), <code><a class="el" href="group__group__errors.html#ga224b2c2b830135f12b53536f189b4ebd" title="A soap_status error code: unexpected end of file, no input, transmission interrupted or timed out (sa...">SOAP_EOF</a></code> (not ready), or <code><a class="el" href="group__group__errors.html#ga5087817634de39f79e74246b1eb4da54" title="A soap_status error code: a TCP/IP connection error occured. ">SOAP_TCP_ERROR</a></code> (error) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga8bb9d541b641a6c261d8879363c7694c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_recv_empty_response </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive an HTTP response message from the server that is assumed to be empty. </p>
<p>This function receives an HTTP response message from the server and is typically used when HTTP 202 Accepted or HTTP 200 OK is expected without data. Therefore the HTTP response message body is assumed to be empty. If the message is not empty then a fault message with the HTTP body as the fault string will be produced and the <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> is set to the HTTP status code received. This function reads input from <code><a class="el" href="structsoap.html#a285e8a3584ffb1cea07a700c951e436d" title="The source to read data from when non-NULL, which in C++ is a std::istream object and in C is a 0-ter...">soap::is</a></code> when non-NULL, or from <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or from <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code>. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code such as the HTTP status code received.</p><dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga1a9e19e214e19769e8e859ac631e5d63"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_recv_fault </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>check</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse and deserialize the SOAP Fault. </p>
<p>This function parses and deserializes the SOAP Fault such that <code><a class="el" href="structsoap.html#a920e2840ab2c816378059022dcfd96e0" title="The soap::fault points to a SOAP_ENV__Fault structure with the SOAP Fault that was received or that c...">soap::fault</a></code> points to a <code><a class="el" href="struct_s_o_a_p___e_n_v_____fault.html" title="SOAP Fault structure. ">SOAP_ENV__Fault</a></code> structure. If the specified <code>check</code> parameter is nonzero, this function attempts to parse the SOAP Fault that may be present (it checks), but if no <em><code>SOAP-ENV:Fault</code></em> element is present returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code>. If the specified <code>check</code> parameter is zero, this function parses the SOAP Fault that is expected to be present, but if <em><code>SOAP-ENV:Fault</code></em> element is present returns the HTTP error code received (when between 300 and 599) or the <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> code.</p><dl class="section return"><dt>Returns</dt><dd>a nonzero <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">check</td><td>flag to check or expect a SOAP Fault </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga95afd0022acb20ad188ddbd5b54486dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_recv_header </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse and deserialize the SOAP Header. </p>
<p>This function parses and deserializes the SOAP Header such that <code><a class="el" href="structsoap.html#ac091dfe4e01b6a082d916c381e7006ba" title="The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...">soap::header</a></code> points to a <code><a class="el" href="struct_s_o_a_p___e_n_v_____header.html" title="SOAP Header structure. ">SOAP_ENV__Header</a></code> structure.</p><dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0390e58bd2a3ebe6fe3a46de0534a614"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_response </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the context for server-side sending and send a HTTP response header. </p>
<p>This function initializes the context for sending at the server side and sends a HTTP response header with the specified <code>status</code> code. The <code>status</code> code parameter controls the behavior of the HTTP header sent and how the message should be send after calling this function:</p><ul>
<li><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> sends a HTTP 200 OK header with HTTP content type "text/xml" and the HTTP content length value of <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> or chunked transfer encoding if the <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> mode is set, i.e. chunked transfers avoid having to compute <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> such as by sending the message twice, the first time to compute the message length using <code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code> and <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>.</li>
<li>HTTP codes 200 to 599 sends the corresponding HTTP header with HTTP content type "text/xml" and the HTTP content length value of <code><a class="el" href="structsoap.html#a407dae4bc84d0e7b809d51a3b8798e0c" title="Message length counter value of the message received and counter value of the HTTP content length hea...">soap::count</a></code> or chunked transfer encoding if the <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> mode is set.</li>
<li><code><a class="el" href="group__group__io.html#ga17cdc287dd916e5d2b3467ccec177d5a" title="A special soap_status error code to signal that a custom HTTP response is present and no HTTP respons...">SOAP_HTML</a></code> sends a HTTP 200 OK header with HTTP content type "text/html" and sets the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to accumulate the message in memory to determine the HTTP content length.</li>
<li><code><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99" title="A special soap_status error code to signal that a custom file-based HTTP response is present and no H...">SOAP_FILE</a></code> sends a HTTP 200 OK header with HTTP content type <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> and if the <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> mode is not set, sets the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to accumulate the message in memory to determine the HTTP content length.</li>
<li><code><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99" title="A special soap_status error code to signal that a custom file-based HTTP response is present and no H...">SOAP_FILE</a> + status</code> where <code>status</code> is a HTTP status code between 200 and 599, sends the corresponding HTTP header with HTTP content type <code><a class="el" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11" title="String with HTTP content type header value received, can also be assigned to specify a content type h...">soap::http_content</a></code> and f the <code><a class="el" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51" title="soap_mode IO output flag value to send HTTP chunked messages, buffers the message in packets of size ...">SOAP_IO_CHUNK</a></code> mode is not set, sets the context to <code><a class="el" href="group__group__flags.html#gaf7cbb692f85f8633c4efc66dfae41e9e" title="soap_mode IO output flag value to store messages temporarily before transmission, e...">SOAP_IO_STORE</a></code> to accumulate the message in memory to determine the HTTP content length. This function returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code when an error occurred.</li>
</ul>
<p>Besides <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code>, other options to return a HTTP status code are:</p><ul>
<li>Return the value of <code><a class="el" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a" title="Return an HTTP response message with an empty HTTP body from a service back to the client or peer...">soap_send_empty_response</a></code> to produce an empty HTTP response message with the specified HTTP status code.</li>
<li>Likewise, return a HTTP status code between 200 and 299 directly to produce an empty HTTP response message with the given HTTP status code.</li>
<li>Return a HTTP status code between 300 and 599 directly to produce an HTTP response message with the given HTTP status code and a SOAP Fault message body.</li>
</ul>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16">fget</a> = my_get; <span class="comment">// HTTP GET handler to serve HTTP GET</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_get(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <a class="code" href="group__group__context.html#gaf6fa6e197f360834eae124fa37e68cf7">soap_set_omode</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>); <span class="comment">// make sure to chunk the transfers because we do not compute the content length</span></div><div class="line">  <span class="comment">// serve HTTP GET request that has path /xml so in this example we respond with XML</span></div><div class="line">  <span class="keywordflow">if</span> (strcmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/xml&quot;</span>) == 0)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="comment">// serve HTTP GET request that has path /html so in this example we respond with HTML</span></div><div class="line">  <span class="keywordflow">if</span> (strcmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/html&quot;</span>) == 0)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga17cdc287dd916e5d2b3467ccec177d5a">SOAP_HTML</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Example&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Some text&lt;/body&gt;&lt;/html&gt;\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="comment">// serve HTTP GET request that has path /json so in this example we respond with JSON</span></div><div class="line">  <span class="keywordflow">if</span> (strcmp(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="stringliteral">&quot;/json&quot;</span>) == 0)</div><div class="line">  {</div><div class="line">    soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;application/json; charset=utf-8&quot;</span>;</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;{ \&quot;title\&quot;: \&quot;Example\&quot;, \&quot;doc\&quot;: \&quot;Some text\&quot; }\n&quot;</span>)</div><div class="line">     || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">  }</div><div class="line">  <span class="comment">// respond with HTTP 400 Bad Request and HTML message</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;text/html; charset=utf-8&quot;</span>;</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a> + 400)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;html&gt;&lt;body&gt;Bad Request&lt;/body&gt;&lt;/html&gt;\n&quot;</span>)</div><div class="line">   || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16">fget</a> = my_get; <span class="comment">// HTTP GET handler to serve HTTP GET</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_get(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="comment">// serve HTTP GET request, here we compute the content length instead of chunked transfer</span></div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba">soap_begin_count</a>(soap)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line">   || <a class="code" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4">soap_end_count</a>(soap)</div><div class="line">   || <a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">   || <a class="code" href="group__group__io.html#ga7712f5bc36127050a11ad995d0593bdc">soap_send</a>(soap, <span class="stringliteral">&quot;&lt;doc title=\&quot;Example\&quot;&gt;Some text&lt;/doc&gt;\n&quot;</span>)</div><div class="line">   || <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16">fget</a> = my_get; <span class="comment">// HTTP GET handler to serve HTTP GET</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_get(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  FILE *fd = NULL;</div><div class="line">  <span class="keywordtype">char</span> *s = strchr(soap-&gt;<a class="code" href="structsoap.html#a3c2bd2822146a8ccca20f8f217c2f309">path</a>, <span class="charliteral">&#39;?&#39;</span>);</div><div class="line">  <span class="keywordflow">if</span> (!s || strcmp(s, <span class="stringliteral">&quot;?wsdl&quot;</span>))</div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#gac62f5f70e545ea8fbcbb181e88750d56">SOAP_GET_METHOD</a>;</div><div class="line">  fd = <a class="code" href="group__group__callbacks.html#ga9b4985eb5a588f4c16ad88ef7ca329dc">fopen</a>(<span class="stringliteral">&quot;myservice.wsdl&quot;</span>, <span class="stringliteral">&quot;rb&quot;</span>);</div><div class="line">  <span class="keywordflow">if</span> (!fd)</div><div class="line">    <span class="keywordflow">return</span> 404; <span class="comment">// return HTTP 404 Not Found</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> = <span class="stringliteral">&quot;text/xml&quot;</span>;</div><div class="line">  <a class="code" href="group__group__context.html#gaf6fa6e197f360834eae124fa37e68cf7">soap_set_omode</a>(<a class="code" href="group__group__flags.html#gaea7443dc67c979b06cf347ed16db1b51">SOAP_IO_CHUNK</a>);</div><div class="line">  <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614">soap_response</a>(soap, <a class="code" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99">SOAP_FILE</a>) == <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">while</span> (1)</div><div class="line">    {</div><div class="line">      <span class="keywordtype">size_t</span> r = fread(soap-&gt;<a class="code" href="structsoap.html#a194bcafed0c3e368b92f452fc80b2d31">tmpbuf</a>, 1, <span class="keyword">sizeof</span>(soap-&gt;<a class="code" href="structsoap.html#a194bcafed0c3e368b92f452fc80b2d31">tmpbuf</a>), fd);</div><div class="line">      <span class="keywordflow">if</span> (!r || <a class="code" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86">soap_send_raw</a>(soap, soap-&gt;<a class="code" href="structsoap.html#a194bcafed0c3e368b92f452fc80b2d31">tmpbuf</a>, r))</div><div class="line">        <span class="keywordflow">break</span>;</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <a class="code" href="group__group__callbacks.html#gab9591dd80dbb0e571784bad5421b2202">fclose</a>(fd);</div><div class="line">  <a class="code" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9">soap_end_send</a>(soap);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga06d59094afa3df6b1b9f6b2bb484207c">soap_closesock</a>(soap);</div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code>, <code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code>, <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code>, <code><a class="el" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a" title="Return an HTTP response message with an empty HTTP body from a service back to the client or peer...">soap_send_empty_response</a></code>, <code><a class="el" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16" title="Callback to implement logic at the server-side to serve responses to HTTP GET requests from clients...">soap::fget</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>, <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf2bda0187489c8f2b9857f61b96ad0e0" title="Callback to implement logic at the server-side to serve responses to HTTP DELETE requests from client...">soap::fdel</a></code>, <code><a class="el" href="group__group__callbacks.html#ga65272c1ecb5ed9925a5a670cf7e77d10" title="Callback to implement logic at the server-side to serve responses to HTTP OPTION requests from client...">soap::fopt</a></code>, <code><a class="el" href="group__group__callbacks.html#gadff52b7b3ecc16379eb2d7b1ff361978" title="Callback to implement logic at the server-side to serve responses to HTTP HEAD requests from clients...">soap::fhead</a></code>, <code><a class="el" href="structsoap.html#afb22ae0a494a35268914286bd00446ab" title="User-definable string that specifies an extra HTTP header or headers when separated by CRLF...">soap::http_extra_header</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">status</td><td>HTTP status code 200 to 599 or <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> (same as 200 OK) or <code><a class="el" href="group__group__io.html#ga17cdc287dd916e5d2b3467ccec177d5a" title="A special soap_status error code to signal that a custom HTTP response is present and no HTTP respons...">SOAP_HTML</a></code> or <code><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99" title="A special soap_status error code to signal that a custom file-based HTTP response is present and no H...">SOAP_FILE</a></code> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga7712f5bc36127050a11ad995d0593bdc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_send </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send a string. </p>
<p>This function sends a 0-terminated string to <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code> when non-NULL, or to <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or or to <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code> when nonzero.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code>, <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, <code><a class="el" href="group__group__io.html#ga9c251be717c7c4044dac7a79ecd6163a" title="Initialize the context for sending. ">soap_begin_send</a></code>, <code><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9" title="Finalize the context after sending. ">soap_end_send</a></code>, <code><a class="el" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86" title="Send raw bytes. ">soap_send_raw</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">s</td><td>0-terminated string to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga6ac5e550072a59c8b6d432b63cc3543a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_send_empty_response </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return an HTTP response message with an empty HTTP body from a service back to the client or peer. </p>
<p>This function sends an empty response back to the client. The response includes the specified <code>status</code> HTTP status code in the HTTP header but the HTTP body is empty. This function should be used with HTTP PUT or PATCH requests and "one-way" SOAP messaging with HTTP POST. This function sends to <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or to <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code> when non-NULL, or to <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code>. Returns <code><a class="el" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d" title="An internal soap_status error code to signal that an HTTP response must not be produced. ">SOAP_STOP</a></code> and sets <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code> to <code><a class="el" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d" title="An internal soap_status error code to signal that an HTTP response must not be produced. ">SOAP_STOP</a></code> to halt further response messaging to the client or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code when the message could not be sent.</p>
<p>Besides <code><a class="el" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a" title="Return an HTTP response message with an empty HTTP body from a service back to the client or peer...">soap_send_empty_response</a></code>, other options to return an HTTP status code are:</p><ul>
<li>Use <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code> using <code><a class="el" href="group__group__io.html#ga05be99343f556fe70940145e874cdb99" title="A special soap_status error code to signal that a custom file-based HTTP response is present and no H...">SOAP_FILE</a> + status</code> to produce an HTTP response message with the specified HTTP status code.</li>
<li>Return a HTTP status code between 200 and 299 directly to produce an empty HTTP response message with the given HTTP status code.</li>
<li>Return a HTTP status code between 300 and 599 directly to produce an HTTP response message with the given HTTP status code and a SOAP Fault message body.</li>
</ul>
<dl class="section user"><dt>Examples:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854">fput</a> = my_put; <span class="comment">// HTTP PUT handler to serve HTTP PUT</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_put(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordtype">size_t</span> len;</div><div class="line">  <span class="keywordtype">char</span> *message = <a class="code" href="group__group__io.html#gae2cd37f875d3314eec314b8723e2ffd8">soap_http_get_body</a>(soap, &amp;len);</div><div class="line">  <a class="code" href="group__group__io.html#ga86b0c04e8baa911fc57e7f1220f9eb8f">soap_end_recv</a>(soap);</div><div class="line">  ... <span class="comment">// use the message data</span></div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a>(soap, 202); <span class="comment">// HTTP 202 Accepted</span></div><div class="line">}</div></div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main()</div><div class="line">{</div><div class="line">  <span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">  soap-&gt;<a class="code" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854">fput</a> = my_put; <span class="comment">// HTTP PUT handler to serve HTTP PUT</span></div><div class="line">  ... <span class="comment">// serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve</span></div><div class="line">}</div><div class="line"><span class="keywordtype">int</span> my_put(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a> &amp;&amp; <a class="code" href="group__group__misc.html#gae2bfad49979faa3a625aca44acaa017c">soap_tag_cmp</a>(soap-&gt;<a class="code" href="structsoap.html#ae5e98733a4349b5e1466a9e0ccc22c11">http_content</a>, <span class="stringliteral">&quot;text/xml*&quot;</span>) == 0)</div><div class="line">  {</div><div class="line">    soap_dom_element *<a class="code" href="structsoap.html#ab7114dcbd53dfdb3518af7bb3e2d41ab">dom</a> = soap_new_xsd__anyType(soap);</div><div class="line">    <span class="comment">// get dom, don&#39;t use soap_read_xsd__anyType because we are already reading from a socket</span></div><div class="line">    <span class="keywordflow">if</span> (soap_in_xsd__anyType(soap, <span class="stringliteral">&quot;doc&quot;</span>, dom, NULL) == <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>)</div><div class="line">    {</div><div class="line">      ... <span class="comment">// inspect the DOM using the DOM API functions</span></div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a>(soap, 202); <span class="comment">// HTTP 202 Accepted</span></div><div class="line">    }</div><div class="line">  }</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#ga6ac5e550072a59c8b6d432b63cc3543a">soap_send_empty_response</a>(soap, 400); <span class="comment">// HTTP 400 Bad Request</span></div><div class="line">}</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code>, <code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code>, <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code>, <code><a class="el" href="group__group__io.html#ga0390e58bd2a3ebe6fe3a46de0534a614" title="Initialize the context for server-side sending and send a HTTP response header. ">soap_response</a></code>, <code><a class="el" href="group__group__callbacks.html#gae022204ff7004df2d5ac9e083cbb5b16" title="Callback to implement logic at the server-side to serve responses to HTTP GET requests from clients...">soap::fget</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf263ffe14d8c2508ce4c734d4f33a854" title="Callback to implement logic at the server-side to serve responses to HTTP PUT requests from clients...">soap::fput</a></code>, <code><a class="el" href="group__group__callbacks.html#ga808a6a9b7e6d17e039fb53a5e8a9b84a" title="Callback to implement logic at the server-side to serve responses to HTTP PATCH requests from clients...">soap::fpatch</a></code>, <code><a class="el" href="group__group__callbacks.html#gaf2bda0187489c8f2b9857f61b96ad0e0" title="Callback to implement logic at the server-side to serve responses to HTTP DELETE requests from client...">soap::fdel</a></code>, <code><a class="el" href="group__group__callbacks.html#ga65272c1ecb5ed9925a5a670cf7e77d10" title="Callback to implement logic at the server-side to serve responses to HTTP OPTION requests from client...">soap::fopt</a></code>, <code><a class="el" href="group__group__callbacks.html#gadff52b7b3ecc16379eb2d7b1ff361978" title="Callback to implement logic at the server-side to serve responses to HTTP HEAD requests from clients...">soap::fhead</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d" title="An internal soap_status error code to signal that an HTTP response must not be produced. ">SOAP_STOP</a></code> </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">status</td><td>HTTP status code 200 to 599 or <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> (same as 200 OK) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gab03e7a2c2605004c7f74be27738cc629"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_send_fault </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return an HTTP error with a SOAP Fault message from a service. </p>
<p>This function sends an error response back to the client and is used at the server side by <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> after an error occurred to propagate the fault to the client. This function sends to <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or to <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code> when non-NULL, or to <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code>.</p><dl class="section return"><dt>Returns</dt><dd>the value of <code><a class="el" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2" title="The soap context soap_status (int) error code of the last operation or SOAP_OK (zero) ...">soap::error</a></code>, a nonzero error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gab3b1ba631a0c47d67fe31474982bde86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_send_raw </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send raw bytes. </p>
<p>This function sends raw bytes of data to <code><a class="el" href="structsoap.html#a27b166e404c7c98cfa45d6d7a5da90c0" title="The sink to write data to when non-NULL, which in C++ is a std::ostream object and in C is a pointer ...">soap::os</a></code> when non-NULL, or to <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> when valid, or or to <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code> when nonzero.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga323e88327f1e0a1ce00b1428d7d9b4ba" title="Initialize context to count message length for sending. ">soap_begin_count</a></code>, <code><a class="el" href="group__group__io.html#gae2099fe49c19fb1409c31ec3d51fd8b4" title="Finalize context to count message length for sending. ">soap_end_count</a></code>, <code><a class="el" href="group__group__io.html#ga9c251be717c7c4044dac7a79ecd6163a" title="Initialize the context for sending. ">soap_begin_send</a></code>, <code><a class="el" href="group__group__io.html#ga290ddb46afdbf5ec6669b6ac8daca5c9" title="Finalize the context after sending. ">soap_end_send</a></code>, <code><a class="el" href="group__group__io.html#gab3b1ba631a0c47d67fe31474982bde86" title="Send raw bytes. ">soap_send_raw</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
    <tr><td class="paramname">s</td><td>data to send </td></tr>
    <tr><td class="paramname">n</td><td>length of data to send </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3096038c328d84f90d54e156f9cb46f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void soap_serializeheader </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Serialize the SOAP Header pointed to by <code><a class="el" href="structsoap.html#ac091dfe4e01b6a082d916c381e7006ba" title="The soap::header points to a SOAP_ENV__Header structure with the SOAP Header that was received or tha...">soap::header</a></code> before emitting it with <code><a class="el" href="group__group__io.html#ga07e242fefbde797cf9f76ff97f788334" title="Emit the SOAP Header pointed to by soap::header ">soap_putheader</a></code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga51dba7706a505240bd8935c0b28e419d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_serve </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Serve a pending request. </p>
<p>This function is auto-generated by soapcpp2 and serves the pending request on <code><a class="el" href="structsoap.html#a1579bd8bd106afc9a906a673ca473046" title="The socket set by soap_accept (or the C++ service class accept method) or soap_connect or soap_connec...">soap::socket</a></code> or on standard input/output <code><a class="el" href="structsoap.html#a192c25cc206668600212fd34f6541f34" title="The file descriptor to read data from when no socket communications are set (soap::socket == SOAP_INV...">soap::recvfd</a></code> and <code><a class="el" href="structsoap.html#a200d71a901cdc5c9aa02140e9d2369b9" title="The file descriptor to write data to when no socket communications are set (soap::socket == SOAP_INVA...">soap::sendfd</a></code>, e.g. for CGI and FastCGI services. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<p>This auto-generated function implements the following behavior:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(<span class="keyword">struct</span> soap *soap)</div><div class="line">{</div><div class="line">  <span class="comment">// keep socket open for HTTP keep-alive for maximum of soap-&gt;max_keep_alive iterations when nonzero</span></div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a> = soap-&gt;<a class="code" href="structsoap.html#a1d7aca6ac1d62302102c17508a8b0ec0">max_keep_alive</a> + 1;</div><div class="line">  <span class="keywordflow">do</span></div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a> &gt; 0 &amp;&amp; soap-&gt;<a class="code" href="structsoap.html#a1d7aca6ac1d62302102c17508a8b0ec0">max_keep_alive</a> &gt; 0)</div><div class="line">      soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a>--;</div><div class="line">    <span class="comment">// parse HTTP headers and call GET, PUT, PATCH or DELETE callback when set</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb">soap_begin_serve</a>(soap))</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a> &gt;= <a class="code" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d">SOAP_STOP</a>)  <span class="comment">// request was handled by plugin handler</span></div><div class="line">        <span class="keywordflow">continue</span>;                    <span class="comment">// so continue the keep-alive loop</span></div><div class="line">      <span class="keywordflow">return</span> soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a>;</div><div class="line">    }</div><div class="line">    <span class="comment">// call soap_serve_request generated by soapcpp2 to dispatch the SOAP/XML request</span></div><div class="line">    <span class="keywordflow">if</span> ((<a class="code" href="group__group__io.html#ga4e138b90120efda4a1259d93d79bd2ad">soap_serve_request</a>(soap) || (soap-&gt;<a class="code" href="group__group__callbacks.html#ga76024ad8bab31b591432a5dbdcf3a0a4">fserveloop</a> &amp;&amp; soap-&gt;<a class="code" href="group__group__callbacks.html#ga76024ad8bab31b591432a5dbdcf3a0a4">fserveloop</a>(soap)))</div><div class="line">     &amp;&amp; soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a></div><div class="line">     &amp;&amp; soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a> &lt; <a class="code" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d">SOAP_STOP</a>)</div><div class="line">      <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#gab03e7a2c2605004c7f74be27738cc629">soap_send_fault</a>(soap);</div><div class="line">  } <span class="keywordflow">while</span> (soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a>);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><p>The <code><a class="el" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb" title="Initiates serving a pending client request. ">soap_begin_serve</a></code> function processes the HTTP headers and XML SOAP headers if present. The <code><a class="el" href="group__group__io.html#ga4e138b90120efda4a1259d93d79bd2ad" title="Process a pending request. ">soap_serve_request</a></code> function is auto-generated by soapcpp2, when applicable, and parses the SOAP/XML request element to dispatch the SOAP/XML request to a service operation.</p>
<p>If soapcpp2 is not used or does not generate <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> but <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> is required to serve non-SOAP requests, for example to serve JSON or GET/PUT/PATCH/DELETE requests, then the following simplified <code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code> implementation works just fine:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> <a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(<span class="keyword">struct</span> soap *<a class="code" href="structsoap.html#a2ba5188ff4e8d734652a55a11842e79c">ctx</a>)</div><div class="line">{</div><div class="line">  soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a> = soap-&gt;<a class="code" href="structsoap.html#a1d7aca6ac1d62302102c17508a8b0ec0">max_keep_alive</a> + 1;</div><div class="line">  <span class="keywordflow">do</span></div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a> &gt; 0 &amp;&amp; soap-&gt;<a class="code" href="structsoap.html#a1d7aca6ac1d62302102c17508a8b0ec0">max_keep_alive</a> &gt; 0)</div><div class="line">      soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a>--;</div><div class="line">    <span class="comment">// parse HTTP headers and call GET, PUT, PATCH or DELETE callback when set</span></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb">soap_begin_serve</a>(soap))</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a> &gt;= <a class="code" href="group__group__errors.html#gaa03308d50b94828cbc49724d049d9d2d">SOAP_STOP</a>) <span class="comment">// request was handled by plugin handler</span></div><div class="line">        <span class="keywordflow">continue</span>;                   <span class="comment">// so continue the keep-alive loop</span></div><div class="line">      <span class="keywordflow">return</span> soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a>;</div><div class="line">    }</div><div class="line">    soap-&gt;<a class="code" href="structsoap.html#ab85f5d42702963d13ea540bd9876e6d2">error</a> = 400;              <span class="comment">// Bad Request because we aren&#39;t serving anything else</span></div><div class="line">    <span class="keywordflow">return</span> <a class="code" href="group__group__io.html#gab03e7a2c2605004c7f74be27738cc629">soap_send_fault</a>(soap);   <span class="comment">// so we report an error</span></div><div class="line">  } <span class="keywordflow">while</span> (soap-&gt;<a class="code" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83">keep_alive</a>);</div><div class="line">  <span class="keywordflow">return</span> <a class="code" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0">SOAP_OK</a>;</div><div class="line">}</div></div><!-- fragment --><dl class="section user"><dt>Example:</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;soapH.h&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>soap *soap = <a class="code" href="group__group__context.html#ga87c20488b2dc680aaa7689b1d024989c">soap_new</a>();</div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a78199a81c504833047224a0ceff6f906">accept_timeout</a> = 3600;                <span class="comment">// exit loop when no request arrives in one hour</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a711bb3a53de7cc62429e4d3a2e0b5474">send_timeout</a> = soap_recv_timeout = 5; <span class="comment">// 5 seconds max socket stall time (unlimited by default)</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#afcf1d236d052579122f785d7639c43c7">transfer_timeout</a> = 30;                <span class="comment">// 30 seconds max message transfer time (unlimited by default)</span></div><div class="line">soap-&gt;<a class="code" href="structsoap.html#a345900c2db67e915ceb02bfa21ecbcbd">recv_maxlength</a> = 1048576;             <span class="comment">// limit messages received to 1MB (2GB by default)</span></div><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18">soap_bind</a>(soap, NULL, PORTNUM, BACKLOG)))</div><div class="line">{</div><div class="line">  <span class="keywordflow">while</span> (1)</div><div class="line">  {</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__soap.html#gaaae8747f4cdacee575875c3a2488d99c">soap_valid_socket</a>(<a class="code" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6">soap_accept</a>(soap)))</div><div class="line">    {</div><div class="line">      <span class="keywordflow">if</span> (<a class="code" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d">soap_serve</a>(soap))</div><div class="line">        <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (soap-&gt;<a class="code" href="structsoap.html#a10b66d6d489690b7d0f591ae2633dd13">errnum</a>) <span class="comment">// accept failed, try again after 1 second</span></div><div class="line">    {</div><div class="line">      <a class="code" href="group__group__fault.html#ga931a4ab6df2553b48a0c270f8a0a88af">soap_print_fault</a>(soap, stderr);</div><div class="line">      sleep(1);</div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span> <span class="comment">// accept timed out, quit looping</span></div><div class="line">    {</div><div class="line">      <span class="keywordflow">break</span>;</div><div class="line">    }</div><div class="line">    <a class="code" href="group__group__context.html#gaf7d0176161e9def36981e24faa1913d9">soap_destroy</a>(soap);</div><div class="line">    <a class="code" href="group__group__context.html#ga81a009ae1ea825a05e5241e2b7a8ece9">soap_end</a>(soap);</div><div class="line">  }</div><div class="line">}</div><div class="line"><a class="code" href="group__group__context.html#ga57108ca4681186e58b5b189c3528f10a">soap_free</a>(soap);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__with.html#ga40cbd680e7dbdeb63bce1d6d4b7b9620" title="When this macro is defined at compile time (undefined by default), IPv6 support is enabled and both I...">WITH_IPV6</a></code>, <code><a class="el" href="group__group__with.html#ga2854fe8474c2f87a9916d892306cb94c" title="When this macro is defined at compile time (undefined by default), IPv6-only is enabled for port bind...">WITH_IPV6_V6ONLY</a></code>, <code><a class="el" href="group__group__flags.html#ga388dae9abc80cd6f6d0ecfba383da03b" title="soap_mode IO input/output flag value to use UDP datagrams, message size is limited to UDP packet size...">SOAP_IO_UDP</a></code>, <code><a class="el" href="structsoap.html#ad98f12f602efdde049dbd367a43e7cb0" title="User-definable setsockopt level SOL_SOCKET flags (0 by default), when nonzero sets the soap::socket f...">soap::accept_flags</a></code>, <code><a class="el" href="structsoap.html#a6b18b017ce2c77ac2b6331469094de59" title="User-definable setsockopt level SOL_SOCKET flags when binding soap::master socket (the value is 0 by ...">soap::bind_flags</a></code>, <code><a class="el" href="structsoap.html#a08f1b076f0f041cdf89b9a969520fd4a" title="User-definable flag, when nonzero uses AF_INET6 instead of PF_UNSPEC when binding the soap::master so...">soap::bind_inet6</a></code>, <code><a class="el" href="structsoap.html#a90e04027ea9efa26e550f5438ab9f3d6" title="User-definable flag, when nonzero enables IPPROTO_IPV6 setsockopt IPV6_V6ONLY when binding the soap::...">soap::bind_v6only</a></code>, <code><a class="el" href="structsoap.html#af2b1fc40a14f7ed925658246a26497c8" title="User-definable value to set SO_RCVBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::rcvbuf</a></code>, <code><a class="el" href="structsoap.html#a02a7fffd05ff6e6c751f2033ef83854f" title="User-definable value to set SO_SNDBUF setsockopt (the value is SOAP_BUFLEN by default) ...">soap::sndbuf</a></code>, <code><a class="el" href="structsoap.html#ab649b8f3b71081d14ec6350ab4b06794" title="The socket set by soap_bind (or the C++ service class bind method) to serve as the master socket boun...">soap::master</a></code>, <code><a class="el" href="group__group__io.html#ga0a9725a3edbc27b97456190fee47cc18" title="Bind and listen to a port. ">soap_bind</a></code>, <code><a class="el" href="group__group__io.html#gaec0e1aecc2d5479d8099762feb4713c6" title="Accept a connection with a client. ">soap_accept</a></code>, <code><a class="el" href="group__group__ssl.html#ga990083effa5d8ed931fd75dc2630a2cc" title="Accept SSL/TLS connection. ">soap_ssl_accept</a></code>, <code><a class="el" href="structsoap.html#a3d93ba968bb58373f5884177a7ec0d83" title="HTTP keep-alive flag (try to enable when -1, disabled when 0) and counter (enabled when &gt;0) ...">soap::keep_alive</a></code>, <code><a class="el" href="structsoap.html#a1d7aca6ac1d62302102c17508a8b0ec0" title="User-definable maximum number of keep-alive message exchanges per connection (the value is SOAP_MAXKE...">soap::max_keep_alive</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga4e138b90120efda4a1259d93d79bd2ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int soap_serve_request </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structsoap.html">soap</a> *&#160;</td>
          <td class="paramname"><em>soap</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process a pending request. </p>
<p>This function is auto-generated by soapcpp2 and parses the SOAP/XML request element to dispatch the SOAP/XML request to a service operation. Returns <code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code.</p>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="group__group__io.html#ga51dba7706a505240bd8935c0b28e419d" title="Serve a pending request. ">soap_serve</a></code>, <code><a class="el" href="group__group__io.html#ga5652f1b77271d434d0a4b66d5a607adb" title="Initiates serving a pending client request. ">soap_begin_serve</a></code>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="group__group__errors.html#ga3b10a68f354f39cbb0fe0d043ad4c7c0" title="The soap_status code for no error (zero) ">SOAP_OK</a></code> or a <code><a class="el" href="group__group__errors.html#gac0eadf8f72bacb5b41b750beaeca0444" title="Status and error codes are int values, a zero value or SOAP_OK (0) means no error, nonzero means error. ">soap_status</a></code> error code </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">soap</td><td><code><a class="el" href="structsoap.html" title="Context with the engine state. ">soap</a></code> context </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr class="footer">
<address class="footer">
Copyright (C) 2021, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Tue Apr 20 2021 19:48:13 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.11</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
